In 1999 he was elected governor of Sokoto State on the platform of the All Nigeria Peoples Party (ANPP), and was re-elected for the ANPP in 2003. In March 2002, a Sharia court in Sokoto State freed a 35-year-old woman Safiya Hussaini, who had been sentenced to death by stoning after being found guilty of adultery. Nigeria's justice minister declared Sharia unconstitutional. Attahiru Bafarawa, however, said the Sharia states would not adhere to this declaration.
Under the Bufarawa administration the state made significant improvements in the quality of roads. Schools were upgraded, and enrolment greatly improved due to assurances that all pupils would be taught morals and Islamic religion. The government built over 70 mosques. The water supply was improved through construction of boreholes.
While he was governor, five separate petitions alleging abuse of office, money laundering and official corruption were written against him by individuals and corporate institutions. In October 2006 a task force headed by Nuhu Ribadu of the Economic and Financial Crimes Commission (EFCC) issued a report listing assets owned by 15 state governors that had not been declared on an official register as required by law. Gov. Bafarawa was accused of failing to declare a N200 million property in London which he acquired when he took office.
Less than two months after Bafarawa left office, the state attorney-general forwarded a petition to the Economic and Financial Crimes Commission (EFCC) commission, asking for investigation of his actions in office. The EFCC questioned Bafarawa, and took his passport. In July 2008, the EFCC asked a Federal High Court in Abuja not to release his passport, which he had requested for travel to receive medical treatment.
In October 2009, there was an attack on a convoy of Attahiru Bafarawa and DPP governorship candidate, Alhaji Maigari Dingyadi, at the Sultan Muhammadu Maccido Institute for Islamic Studies in Sokoto. Dingyadi alleged that the attackers were leaders of area boys of the People's Democratic Party, and said they may have been trying to assassinate him. That month the Sokoto State Commissioner of Justice said that the state was about to prosecute Attahiru Bafarawa and five others for alleged misappropriation of N2.919 billion. Bafarawa said the Sokoto commission of inquiry had been set up by the present Governor Aliyu Wamakko solely to discredit him. In December 2009 EFCC officials raided a meeting and arrested Bafarawa, accusing him of involvement in a 6bn naira ($40m) fraud from his time as governor of Sokoto State.