Somalia's Prime Minister Mohamed Hussein Roble says he is committed to free and fair polls after he signed an agreement with regional leaders to allow indirect elections to take place after delays had prompted a crisis.
Clan elders were meant to have selected lawmakers in December, who in turn were due to elect a new president on February 8.
Both procedures failed to take place amid disputes over issues that included the composition of an election commission that would supervise the voting.
The disagreements caused concern that clans could turn on each other and that the al-Shabab militant group could exploit a security vacuum.
"My government and I are committed to implement a free and fair indirect election. We are all responsible to ensure women get their 30 per cent quota (of positions). I urge all state presidents to facilitate and implement this," Roble said at a ceremony after signing the agreement.
The agreement, which was read out at the ceremony, said Roble and the five regional states will select members of the election committee by Sunday.
The deal said elections will be held within the next 60 days, with each region conducting the vote in two venues.
"My dear brothers, politicians, whatever you need is in front of me. Do not search in other places. Let's all forgive one another, and I ask you to forgive me," Roble said.
Somalia was initially aiming to hold its first direct election since civil war erupted in 1991 but delays in preparations and continuous attacks by al-Shabab had forced it to resort to an indirect vote.
President Mohamed Abdullahi Mohamed has sought a second term.
The opposition has accused him of packing electoral boards with his allies.
In April, the lower house of parliament voted to extend the president's four-year term by another two years.
The Senate rejected the extension and troops opposed to the move seized positions in the capital.
They have since returned to barracks.