Yakubu Dogara was elected Speaker of the House in Nigeria Tuesday after winning 182 votes over Femi Gbajabiamila, who picked up 174 votes and was backed by the ruling party. Dogara, a legal practitioner, will serve as speaker of the 8th legislature, local media reported. 

Dogara became speaker despite the ruling All Progressive Congress throwing its support behind Gbajabiamila. The rival Peoples Democratic Party also succeeded in naming Nigerian Sen. Bukola Saraki as the new Senate president on Tuesday. Saraki, a former member of the opposition Peoples Democratic Party (PDP), was the only candidate nominated for the top post. The Senate president is the third most powerful figure in the country.

The tense House and Senate leadership votes suggest President Muhammadu Buhari's coalition could be vulnerable to internal disputes and a future attack from the Peoples Democratic Party, the Associated Press reported. Buhari took office May 29.

The All Progressive Congress seized control of Nigeria's government in March after winning control of the presidency, Senate and House. The victory marked the first time the Peoples Democratic Party was forced from power since the end of military rule in 1999.

Saraki, 52, was a two-term governor of Kwara state. He has helped transform the region from a food importer to an exporter after importing white Zimbabwean farmers to develop commercial agriculture in his state.

Dogara represents the Bogoro/Dass/Tafawa-Balewa federal constituency of Bauchi State. He has served in the Federal House of Representatives since 2007. He is widely known in Nigerian politics for a 2013 bill he sponsored that sought to make it easier to remove the president and vice president from office on charges of misconduct. He is a member of the All Progressives Congress party, but won over Peoples Democratic Party members to become speaker of the House.

The Peoples Democratic Party lost votes in the recent elections after government officials were unable to stop violent attacks from the Boko Haram militant group. Buhari pledged during his inaugration speech to wipe out the Islamist group.

“Boko Haram is a typical example of small fires causing large fires," he said, adding that the group was “a mindless, godless group who are as far away from Islam as one can think of.”