In the mid-2000s, he joined Al-Qaeda in the Islamic Maghreb (AQIM) and became the deputy to Mokhtar Belmokhtar, an emir of AQIM's Sahelian Brigade. At some point during Belmokhtar and Ould Hamaha's relationship it is believed that Belmokhtar married a daughter of Ould Hamaha, further strengthening their relationship. The Canadian diplomat Robert Fowler, who was abducted by AQIM in Niger in 2008, identified Ould Hamaha as one of his kidnappers. After 1 April 2012, he became publicly known as the spokesman of the Islamist militant group Ansar Dine. The MOJWA, in coordination with its allied Militant Islamist groups AQIM and Ansar Dine, took control of Northern Mali from the Battle of Gao in June 2012 until the French Operation Serval in January 2013, which led to the recapture of Northern Mali. Following the capture of Gao, Ould Hamaha became identified as deputy to the MOJWA chief of Gao. In August 2012, he became the chief of staff of MOJWA. Ould Hamaha's actual position in both of these groups was undefined, with one commentator describing him as "a spokesman for the [Islamist] coalition" that ruled Northern Mali.