Somalia's president came under mortar attack in his palace Tuesday, hours after arriving for a rare visit to the increasingly violent capital, witnesses said, but President Abdullahi Yusuf escaped unharmed.

Gunbattles erupted in several different locations in the restive capital, Mogadishu, with insurgents using rocket-propelled grenades and machine guns during the attacks on an Ethiopian military base and a military convoy.

Ethiopian troops protecting government installations battled with Somali insurgents Tuesday, scattering dozens of schoolchildren who were caught in the crossfire as they left their classes, witnesses said.

A government official also narrowly escaped death in a separate attack when his car, traveling in a four vehicle convoy, was hit by remote-controlled land mine — a rarely seen tactic in this restive Horn of Africa nation.

A 12-year-old boy was killed and three of his siblings were wounded in the shelling on the presidential palace.

Yusuf had arrived in Mogadishu from the government stronghold town of Baidoa shortly before the attack began, an Associated Press reporter said.

"Six mortars have been fired at the presidential palace," said Abdiwahid Haji Mumin, who lives near the hilltop palace, known as Villa Somalia. "Two have hit inside the palace and four outside."

Abdullah Ahmed said his 12-year-old son was killed by a mortar that missed the palace. Three of his children were also injured by shrapnel, he told AP.

"They were sleeping when the mortar hit us. It is sad to see your children to be killed in front of you and you can't do anything," Ahmed said.

One Ethiopian military truck with soldiers on board was hit by a rocket and caught fire, said eyewitness Shino Moalin Norow, who sells drinking water near the scene.

There were no immediate reports of casualties.

Ibrahim Omar Sabirye, deputy mayor of Mogadishu received hospital treatment for minor injuries after the attack on his convoy, his bodyguard Abdikadir Ahmed told the AP. Another passenger traveling in the same car was also injured in the blast.

Somalia's government and troops from neighboring Ethiopia drove out a radical Islamic movement late last year, but the government is now struggling with a growing insurgency and the Ethiopians have started pulling out. African Union peacekeepers who began arriving last week have also come under attack. The peacekeepers are the first here in more than a decade.

The peacekeepers, all from Uganda, are the vanguard of a larger force authorized by the United Nations to help the government assert its authority and to allow Ethiopian forces to leave. Insurgents believed to be the remnants of the Council of Islamic Courts have staged almost daily attacks against the government, its armed forces and the Ethiopians.

In Tuesday's violence, teacher Mohamed Hussein Abdi said dozens of his young students fled screaming as fighting broke out close to Hoyga Hamar school.

"We had just finished classes when the fighting broke out," he told The Associated Press. "When the children heard the gunfire they just scattered.

"They were frightened and scattered everywhere. I could not hide myself because I was trying to stop the children running."

The gunmen attacked in minibuses and small cars before fleeing the scene. Ethiopian troops used artillery to return fire, said Abdi.

"Terrorist elements have attacked bases of government troops in the capital," said the Deputy Defense Minister Salad Ali Jelle. "We have repelled them."

However, gunfire could still be heard in the city of 2 million, where escalating violence has forced hundreds to flee.

Meanwhile at least 42 people, mainly children, have died in the last 24 hours from a suspected cholera outbreak in southern Somalia, doctors said Tuesday.

More than 240 others have been hospitalized, and doctors fear more deaths because of the lack of proper medical facilities or medicines in the war-ravaged country.

Somalia descended into chaos in 1991, when warlords overthrew a dictator, carved the capital into armed, clan-based camps, and left most of the rest of the country ungoverned. The transitional government was formed in 2004 with U.N. help but has struggled to assert control.