A BBC correspondent said one person was seriously injured in the attack, moments before the arrival of a plane carrying a United Nations delegation.
It comes a day after some 200 Ethiopian troops left their base at the airport to return home after helping the government defeat Islamists last month.
In Kenya, the US envoy held talks with a top Islamist leader in custody.
US ambassador to Kenya Michael Ranneberger met Sheikh Sharif Sheikh Ahmed at an undisclosed location in Nairobi, a US official told the BBC.
No details were given about what was discussed at the meeting.
The chairman of the Union of Islamic Courts, who is the first Islamist leader to be captured since they fled an Ethiopian advance in December, is seen by the US as a moderate.
The BBC's Mohamed Olad Hassan, at the airport in Mogadishu, says it is unclear who is responsible for the attack and where it was targeted.
Several mortar shells landed at the Mogadishu International Airport and dozens of people who were in the airports grounds fled amid fears of more attacks," witness Ahmed Hersi told the French news agency, AFP.
The Islamists who fled Mogadishu have threatened to wage a guerrilla war against the transitional government and Ethiopian troops.
The government says as many as 3,500 Islamist fighters may still be in Mogadishu.
Mr Ahmed surrendered to Kenyan officials near the Somali border at the weekend.
Ambassador Rannenbergaer said that if Mr Ahmed renounces violence and extremism he could play a part in a future administration in Somalia.
The US and the UN have both urged the Somali government to seek reconciliation with moderate Islamists, but the interim government is opposed to talks with them.
The US backed Ethiopia's intervention and has committed over $40m for development, humanitarian and peacekeeping support to Somalia this year.
On Tuesday, the first 200 Ethiopian soldiers left Mogadishu's airport following a withdrawal ceremony, amid cheers from Somalis.
Ethiopia is determined to pull its troops out as soon as possible, but plans for an African Union force to help ensure peace are still to be finalised, with only Malawi and Uganda offering troops so far.
Prime Minister Meles Zenawi has told journalists that the withdrawal no power vacuum would be left.
"We'll withdraw our troops in three phases. My expectation is that our last phase will coincide with the AU deployment," he said.