Kenya’s army said the number was untrue, but again refused to give its own casualty figures for the assault in the southern Somali base of el-Ade.
The Islamist militant group said it had killed about 100 Kenyan troops.
If it is confirmed that 180 troops were killed, it would be al-Shabab’s deadliest assault since it was formed nearly a decade ago.
Its previous most deadly attack was the killing of 148 people in the day-long assault on Garissa University College in north-eastern Kenya last April.
Somalia’s President Hassan Sheikh Mohamud gave the death toll of 180 in an interview with a Somali television station, while defending his attendance at a memorial for the soldiers in Kenya.
Some Somalis accused him on social media of showing greater concern for the killing of Kenyans than his own nationals.
President Mohamud said it was important to pay tribute to the troops killed in el-Ade, which is in Somalia’s south-western region of Gedo.
“When 180 or close to 200 soldiers who were sent to us are killed in one day in Somalia, it’s not easy,” he told Somali Cable TV.
“The soldiers have been sent to Somalia to help us get peace in our country, and their families are convinced that they died while on duty,” he added.
Kenyan army spokesman David Obonyo said the Somali president’s information was untrue.
“Ask the source of the information to clarify it. Maybe he knows his sources,” he told the BBC.
“Secondly, we should stop trivializing the dead. They are not mere statistics. They ought to be treated with honour and respect,” Col Obonyo added.
Analysis: Tomi Oladipo, BBC Africa security correspondent
The el-Ade attack was hugely embarrassing for Kenya, and it is not surprising that it has rejected the Somali president’s figure without giving its own. Kenya’s government possibly fears that confirming a high death toll would fuel doubts among Kenyans about its military presence in Somalia.
It is unclear where Mr Mohamud got the figure from, and whether he had had intentionally disclosed it, something that could strain diplomatic relations with Kenya.
Kenya’s military is clearly upset with him, but it has previously said that a company-sized battalion, usually made up of 100 to 250 men, was targeted by the militants.
And there is no doubt that this was the bloodiest attack on Kenyan troops since they crossed into Somalia in 2011, even if the exact death toll remains unclear.
The Kenyan army has sought revenge for the attack, carrying out a series of air strikes against suspected al-Shabab bases in southern Somalia, even saying that it has killed the group’s intelligence chief, a claim the militants deny.
Mr Mohamud’s figure is similar to that a community leader in el-Ade gave to the BBC Somali service after the attack on 15 January.
He had counted about 190 bodies, he said.
It is unclear why al-Shabab put the number of killed at about 100, but one possibility is that it excluded ethnic Somalis who were Kenyan soldiers, correspondents say.
After the attack, Kenya said the bombs used by al-Shabab were three times more powerful than those used by al-Qaeda in the 1998 US embassy attack in the capital, Nairobi, which left 224 people dead.
Its troops withdrew from el-Ade 11 days after the attack.
Kenya has about 4,000 troops in the 22,000-strong African Union force battling al-Shabab, which is part of al-Qaeda, in Somalia.
© PEMTSIKATA NEWS