Islamist al-Shabab militants have attacked the presidential palace in the Somali capital, Mogadishu, and entered the heavily fortified compound.
An al-Shabab spokesman said fighting was ongoing, but a government official told the BBC the attack was over and the militants had all been killed.
President Hassan Sheikh Mohamud was not at the palace at the time.
The al-Qaeda-aligned al-Shabab group lost control of Mogadishu in 2011, but often carries out attacks in the city.
The group has vowed to step up attacks during the Islamic holy month of Ramadan.
On Saturday, a suicide car bomb exploded near the capital's parliament building, killing at least four people.
The BBC's Mohammed Moalimu in Mogadishu says President Mohamud was attending a function at the residence of the UN special envoy to Somalia, near the airport.
A large contingent of the Somali military police accompanied him, leaving the presidential palace, known as Villa Somalia, mainly under the protection of African Union soldiers, he says.
The presidential palace is the seat of government and many top government officials live and work there.
It is not clear if the prime minister and speaker of parliament were in the compound when it was attacked.
"We have entered the so-called presidential palace. We have now captured some parts of the palace and fighting is still going on," al-Shabab spokesman Sheikh Abdiasis Abu Musab told the Reuters news agency.
The spokesman said that 14 government soldiers had been killed in the attack.
However a government official, who asked not to be named, told the BBC the situation was now under control and that attackers had all been killed.
He declined to comment on the number of casualties.
'Bullets flying around'
A security official told the AFP news agency that there were at least nine attackers involved in the raid and all had been killed.
The raid is believed to have started with a car bomb at a barrier near the entrance to the compound, after which the militants attacked from two directions, he says.
Halimo Nure, a local resident, told AFP that bullets were "flying around".
"There is shooting and gunfire, there are also explosions like they are using grenades."
Al-Shabab militants staged a similar attack on Villa Somalia in February when a car bomb exploded at the gate of the presidential palace, followed by a fierce gun battle inside.
A high-level meeting on how to beef up security in the capital was held at parliament on Monday night, a statement from the prime minister's office said.
Despite losing Mogadishu and other key cities over the last three years, al-Shabab still controls many smaller towns and rural areas of the country.
Some 22,000 African Union troops are helping the UN-backed government battle al-Shabab, which wants to create an Islamic state.
Latest Stories
-
Walker wants to ‘explore’ Man City exit – Guardiola
6 hours -
Ejura Sekyeredumase MP demands autopsy on resident who died in Police custody
8 hours -
Kusaas Diaspora Union launched to spearhead global unity, development
9 hours -
Bright Simmons: Mahama’s reduction of ministries to 23 amid calls for efficiency, cost-cutting
9 hours -
Maxwell Hanson seeks apology and compensation from Anim Addo over defamation claims
10 hours -
We listen, we don’t judge: What they don’t tell you about being an entrepreneur
11 hours -
Mahama orders Lands Commission to halt sale of State Lands
12 hours -
Chiesa on target as Liverpool ease past Accrington Stanley
12 hours -
Everton appoint Moyes as manager for second time
12 hours -
WACCE describes 2024 elections as one of the violent, deadliest in the 4th Republic
12 hours -
Volta Region movie industry stagnated, needs investors to push – stakeholders
12 hours -
Petition against Chief Justice reflects broader public concerns about Judiciary – Joyce Bawa
12 hours -
Northern Ghana won’t experience fuel shortage – NPA assures
12 hours -
Calm restored in Ejura after mob attack on Police Station
13 hours -
18-year-old herdsman remanded over murder of younger brother
13 hours