It came as the insurgents claimed responsibility for a new attack on Monday.
Somali security forces have touted gains made in recent weeks against the al Qaeda-linked group while fighting alongside local self-defense groups.
But al Shabaab has continued to conduct deadly raids, including two last Friday that killed at least 16 people and another on Monday that police said killed at least five.
Somalia's information ministry said in a statement late on Sunday the operation that killed Nadir happened on Saturday. It said he was al-Shabaab's chief prosecutor and was in line to replace the group's leader, Ahmed Diriye, who is sick.
"His death is a thorn removed from the Somali nation," the ministry's statement said. "The government is grateful to the Somali people and international friends whose cooperation facilitated the killing of this leader who was an enemy of the Somali nation."
Al-Shabaab did not immediately comment on Nadir's death.
Al-Shabaab terrorists have killed tens of thousands of people in bombings since 2006 in their fight to overthrow Somalia's Western-backed central government.
Somalia's President Hassan Sheikh Mohamud, elected by lawmakers in May, has promised to take the fight to the insurgents after three years in which his predecessor, consumed by political infighting, took little action against al-Shabaab.
In al-Shabaab's attack on Monday, two car bombs in the central city of Beledweyne killed at least five people including soldiers and local officials, a police officer told Reuters, adding that more than a dozen others had been injured and the death toll could rise.
Asked for comment, al-Shabaab's military operations spokesman said the group was behind the Beledweyne attack, in which he said dozens of people, including officials and soldiers, had been killed.