Upon graduation, Dileita returned to Djibouti, where he worked at the Directorate-General of Protocol under the Presidency. He became the second ranking diplomat at the embassy of Djibouti in France in early 1990, and subsequently he became Ambassador to Ethiopia in 1997. He also represented Djibouti at the Organization of African Unity, headquartered in Addis Ababa, while serving as Ambassador to Ethiopia, and assisted in the peace talks that ended the 1998-2000 war between Ethiopia and Eritrea. In December 1999, Dileita was charged with negotiating a peace agreement with a faction of the Front for the Restoration of Unity and Democracy ; the negotiations led to the signing of an agreement in February 2000. He became Ambassador to Uganda in mid-2000. After long-time Prime Minister Barkat Gourad Hamadou resigned for health reasons in February 2001, President Ismail Omar Guelleh appointed Dileita as Prime Minister on March 4, 2001, and he took office on March 7. He had no prior experience as a minister. Dileita was elected as the Vice-President of the RPP on July 3, 2003, succeeding Hamadou in that post. Dileita led the ruling coalition, the Union for the Presidential Majority, in the January 2003 parliamentary election, standing as the first candidate on the coalition's list for the District of Djibouti. On May 21, 2005, Dileita was reappointed as Prime Minister after Guelleh's re-election in the April 2005 presidential election; a new government under Dileita was named on May 22. As of 2008, Dileita was the President of the UMP coalition, and he headed the UMP list for the District of Djibouti in the February 2008 parliamentary election. Following the election, in which the UMP won all seats amidst an opposition boycott, he resigned as Prime Minister on March 25, 2008. Guelleh promptly reappointed him on March 26 and named a new government under Dileita on March 27. After Guelleh won a third term in the April 2011 presidential election, he reappointed Dileita as Prime Minister on 11 May 2011. Guelleh retained Dileita in his post even though various other long-serving ministers were dropped from the new government that was announced on 12 May. He was replaced as RPP Vice-President by Abdoulkader Kamil Mohamedin September 2012, as part of an extensive shake-up of the RPP leadership. On 31 March 2013, Dileita was succeeded by Kamil as Prime Minister. Nkosazana Dlamini-Zuma, the Chairperson of the Commission of the African Union, announced on 11 June 2014 that Dileita was appointed as the African Union's Special Envoy for Libya. He was head of the African Union observer mission for the March 2016 Congolese presidential election.