(Bloomberg) -- Anwar Ibrahim has emerged as the winner in a district by-election, clearing the way for the formerly jailed leader to become the nation’s eighth prime minister.

Anwar, 71, leader of the largest party in the ruling coalition, won 71 percent of votes against six other candidates for a parliament seat to represent the coastal town of Port Dickson, the Election Commission announced Saturday. Polling ended at 5 p.m. local time with voter turnout at 58 percent.

While he’s set to replace Mahathir Mohamad as prime minister in a year or two, he has tempered expectations of taking an immediate role in the cabinet. He would first focus on developing his constituency as a tourism destination while working on reforms in the legislative body, giving Mahathir space to run the government. Mahathir has vouched for this, and appeared by Anwar’s side at a rally on Monday.

The Pakatan Harapan coalition engineered the by-election to realize its succession plan for Anwar. The group chose Mahathir as their interim prime minister candidate and Anwar’s wife Wan Azizah Wan Ismail as the deputy for the election in May, as Anwar was ineligible to contest due to a sodomy conviction that’s been widely criticized as political. His full pardon and release was granted within a week of the coalition’s victory. In August, he became the president of People’s Justice Party, the largest in the alliance, without contest.

To contact the reporter on this story: Anisah Shukry in Kuala Lumpur at ashukry2@bloomberg.net

To contact the editors responsible for this story: Yudith Ho at yho35@bloomberg.net, Ruth Pollard

©2018 Bloomberg L.P.