Legislators in Somalia vote president at an airport amidst tension

Somalia's MPs are electing the country's president in a heavily guarded aircraft hangar in Mogadishu, as the rest of the country is not safe.

Traffic has been banned, schools have been shut and a no-fly zone imposed over the capital to prevent attacks.

Despite this, suspected militant Islamists fired mortar rounds close to the venue on Tuesday night.

Somalia, marred by religious and clan conflict, has not had a one-person one-vote democratic election since 1969.

That vote was followed by a coup, dictatorship and conflict involving clan militias and Islamist extremists.

Somalia's rocky road to democracy

The elections are part of a lengthy and complex process to help the East African state rebuild its democracy and achieve stability.

More than 20,000 African Union (AU) troops are stationed in Somalia to prevent militant Islamist group al-Shabab from overthrowing the weak government.

How safe is the airport?

The election hall, a converted aircraft hangar packed with MPs, is at the Mogadishu international airport complex.

It is viewed as the most secure site in Somalia, as the main AU base is there.

The vote was moved to the airport complex from a police academy because of growing fears that al-Shabab could strike.

The 2012 presidential vote was held at the academy, and the 2007 and 2004 vote in neighbouring Kenya and Djibouti respectively.

Who is running?

About 20 men ran for the presidency, but the number has been reduced to four after the first round of voting. The second round is under way, and the top two will battle it out in a third and final vote.

President Hassan Sheikh Mohamud is standing for re-election and he has gone through to the second round.

At least 16 of the original candidates have dual citizenship - nine of them hold US passports, four UK passports and three Canadian passports, according to a leading Somali private radio station.

It means that if US President Donald Trump's ban on Somali citizens entering the US comes into force again, some of them could be affected.

Many Somalis obtained dual nationality after fleeing the decades-long conflict. The US, UK, Kenya and South Africa are among countries where many Somalis have settled.

-BBC