Ahmed was the Prime Minister of Bangladesh from 1988 to 1989 as part of General Ershad's Jatiyo's party. He was also the Minister of Law, Justice and Parliamentary Affairs as part of the Bangladesh Nationalist Party (BNP) of Begum Khaleda Zia's term between 2001 and 2006. In 2010 he became one of the leaders of the BNP.