(CNN) -- Somali President Sheikh Sharif Sheikh Ahmed joined his troops on the front line Wednesday to fight hard-line anti-government Islamists, a presidential aide told a journalist in Mogadishu.
"The president is on the front line leading the fight against Al Shabaab and he is armed with an AK-47," said the aide, who declined to be named.
The aide said that the president is accompanied by government soldiers and forces from the African Union Mission in Somalia.
The chief of Somali Police, Gen. Ali Mohamed Hassan, told reporters that the drive led by the president marks the beginning of a larger operation against Al Shabaab.
Ahmed has a long history of military leadership that has included fighting on front lines. Before he became president in 2009, he led an Islamist movement that took control of the capital in June 2006. After the international community -- led by Ethiopian forces -- ran him from power late that year, he began to cooperate with those same international powers.
He became president of a U.N.-backed unity government, which led the country's parliament to appoint him president.
Also Wednesday, heavy shelling rocked the capital during the evening, killing at least five people and wounding at least eight, according to ambulance service spokesman Ali Musa. The shelling started after clashes erupted in two parts of the city.
Ahlu Sunna fighters -- a Sufi militia aligned with the government -- fought fiercely against al Qaeda-linked Al Shabaab near Bakara market while government forces and Al Shabaab clashed in the north.
CNN's Ben Brumfield contributed to this story.