The airport in Somalia's capital, Mogadishu, has been attacked as the first African Union (AU) peacekeepers arrived in the country.
The mortars were fired during the welcome ceremony
Mortars were fired at the airport as a ceremony to welcome the 400 Ugandan troops took place, correspondents say.
One person was wounded in the attack and three other civilians have died in heavy clashes elsewhere in the city.
Dozens have been killed by insurgents since the Ethiopian-backed government forces defeated Islamists last year.
The AU force is taking over from Ethiopian troops who intervened to help Somalia's transitional government oust the Union of Islamic Courts (UIC).
Somalia enjoyed a six-month lull in the insecurity that has dogged the country for the past 16 years when the UIC was in power last year.
But violence has escalated in the past two months.
The BBC's Mohammed Olad Hassan in Mogadishu says a Somali man was wounded by shrapnel during the airport attack, but most of the eight mortars fired missed their targets.
However, fighting elsewhere in the city was heavy, he said.
Insurgents attacked the old defence ministry compound, using rocket-propelled grenades, and three civilians were killed in the crossfire.
In a separate incident, a local militia clashed with insurgents who were attempting to fire mortars at the presidential palace.
The AU contingent is the first of a 1,700-strong force promised by Uganda's government.
So far, the AU has managed to raise only about half of the 8,000 troops required. Burundi, Nigeria and Ghana are also expected to contribute.
The head of the AU delegation, Geoffrey Mugunya, said on Monday that the mission would not interfere in Somalia's internal affairs, but would support the transitional government's own efforts to train enough security forces.
The BBC's Karen Allen in Uganda says the fear is that, just as happened in Sudan's Darfur region, the force could be under-strength and under-resourced.
Any targeting of Ugandan troops by insurgents in Somalia could give other troop-contributing nations cold feet, derailing the mission, our correspondent adds.