In February 2004, at Nairobi, Kenya, the government endorsed the Transitional Federal Charter of the Somali Republic. On October 10, 2004, in a session held by the TFP in Nairobi, Ahmed was elected as president of the TFG, an interim federal administrative body that he had helped establish earlier in the year. He received 189 votes from the TFG Parliament, while the closest contender, erstwhile Somali ambassador to Washington Abdullahi Ahmed Addou, got 79 votes in the third round of voting. The then incumbent President of Somalia, Abdiqasim Salad Hassan, peacefully withdrew his candidature. Ahmed was sworn in a few days later on October 14, 2004. After his election, Yusuf formed the first council of ministers by appointing cabinet officials in November 2004. One of his key appointments was Ali Mohammed Ghedi as prime minister. On February 26, 2006 the parliament first met inside Somalia, in the city of Baidoa, 260 kilometers northwest of Mogadishu. 210 lawmakers of the 275-member parliament met in a grain warehouse temporarily converted into a meeting hall. For this reason the Transitional Federal Government was sometimes referred to as the "Baidoa Government." In June 2006, Ghedi sacked four ministers, part of the CIA-backed Alliance for the Restoration of Peace and Counter-Terrorism, who ignored his orders to stop fighting the Supreme Islamic Courts Council in the Second Battle of Mogadishu. They were:  Following the success of the Supreme Islamic Courts Council in taking Mogadishu, and the alleged entry of Ethiopian troops into Somalia, members of the transitional government started to resign. Before the resignations started, the government consisted of 42 full ministers and a further 60 assistant ministers. The government would have to resign if more than 50% – 22 – of the full ministers resigned. On 27 July 2006 18 members resigned including the public works minister Osman Ali Atto, who said ""Our government failed to implement national reconciliation, so we have decided to resign."" Ghedi survived a no-confidence vote on July 30 when his opponents failed to obtain the two-thirds majority required to dismiss him. On August 1 eight more ministers resigned in protest at prime minister Ali Mohammed Ghedi's postponement of talks with the Islamic Court. Fisheries Minister Hassan Abshir Farah said ""We had no option but to resign because we believe if the talks are postponed again it will affect the reconciliation efforts""  By August 2, twenty-nine ministers had resigned including eleven full ministers.