In 1992, Ahmed enrolled at the University of Kordofan in Sudan and transferred two years later to Open University in Libya, graduating in 1998 from the College of Sharia and Law. He taught Geography, Arabic and Religious Studies at Juba Secondary School until 2004, when he was nominated to lead the Islamic Courts Union (ICU). The ICU was an alliance comprising regional Sharia courts that controlled most of southern Somalia.

In 2007, Ahmed left the ICU and with other former members founded an opposition group called the Alliance for the Re-liberation of Somalia. He later entered into UN sponsored negotiations with the transitional government under the late President Abdullahi Yusuf Ahmed, and joined Somalia's transitional parliament.

Ahmed was elected to succeed Yusuf after the latter resigned in December 2008. Ahmed took office January 31, 2009.

He was born in the southern Shabeellaha Dhexe region of Somalia. He is a member of the Abgaal clan.

Sharif began his education at the Sheikh Sufi Institute, which was associated with Al-Azhar University in Egypt. He then went to Sudan and entered Kordufan University in late 1992, where he pursued a bachelor's degree in the Arabic language (major) and geography (minor) in the city of Aldalanj.

In 1994, the university was renamed to the University of Dalanj, and Sheikh Sharif left for Tripoli, the capital of Libya, after having completed only two out of the required four years. In Libya, he entered the Open University where he earned a bachelor's degree in Law and Islamic Shariah, graduating in 1998. He has worked as a secondary school teacher of geography, Arabic, and religious studies.