Somalia's President Mohamed Abdullahi Farmajo, right, speaks at a handover ceremony with former president Hassan Sheikh Mohamud, left, at the presidential palace with in Mogadishu, Somalia Thursday, Feb. 16, 2017. The Somalia-based extremist group al-Shabab is claiming responsibility for a mortar attack outside the presidential palace during a handover ceremony for the country's new president. (AP Photo/Farah Abdi Warsameh)

Somalia's President Mohamed Abdullahi Farmajo, right, speaks at a handover ceremony with former president Hassan Sheikh Mohamud, left, at the presidential palace with in Mogadishu, Somalia Thursday, Feb. 16, 2017. The Somalia-based extremist group al-Shabab is claiming responsibility for a mortar attack outside the presidential palace during a handover ceremony for the country's new president. (AP Photo/Farah Abdi Warsameh)

MOGADISHU, Somalia (AP) — Two civilians were killed in an al-Shabab mortar attack outside Somalia’s presidential palace during a handover ceremony for the country’s new leader, police said Thursday, a sign of the enormous challenges facing the man who has promised his government will make security a priority.

At least three mortars slammed into a nearby residential area during the ceremony for President Mohamed Abdullahi Mohamed, also known as Farmajo, Capt. Mohamed Hussein said.

The explosions could be heard near the end of the handover ceremony, startling those attending.

The SITE Intelligence Group, which monitors jihadi websites, cited al-Shabab posts on Twitter that claimed responsibility for the attack.

At the blast scene, rescue workers carried the bloodied body of a child from a house after a mortar shell hit its roof.

ADVERTISEMENT

“They don’t care who gets hit but just want to terrorize everyone,” said Mulki Ahmed, a neighbor.

This was the first mortar attack in the capital since Mohamed, who also holds U.S. citizenship, was elected Feb. 8 to lead a country recovering from a quarter-century of conflict.

“We can’t achieve everything within a few months, therefore I am calling people to support us to serve our country,” Mohamed said at Thursday’s ceremony.

While the al Qaida-linked al-Shabab has been pushed out of most of its key strongholds, it continues to carry out deadly attacks in the capital, Mogadishu.

Recent targets have included hotels and checkpoints manned by Somalia’s security forces or the multinational African Union peacekeeping mission that has been trying to stabilize this Horn of Africa country.

Fears of al-Shabab attacks were a factor in delaying the presidential election multiple times since last year. On the eve of the election, two mortar rounds fired by suspected extremists hit near the voting venue, a heavily guarded former air force base.

ADVERTISEMENT

The election of Mohamed and the peaceful transfer of power have been seen as a key step toward having Somalia’s first fully functioning central government since 1991, when warlords ousted dictator Siad Barre and then turned on each other.

Somalia is now an increasingly important partner for the U.S. military on counterterrorism efforts, including drone strikes against al-Shabab leaders.