The wife of jailed Malaysian opposition leader Anwar Ibrahim has won his parliament seat in a by-election, officials said, in one of two votes held this week that were seen as a test of Prime Minister Najib Razak's leadership.

The announcement on Friday came a day after Wan Azizah Wan Ismail - a medical doctor and mother of six - took the seat in the northern state of Penang, according to unofficial poll results, that was vacated after her husband was jailed in February.

Anwar was imprisoned for five years on charges that he sodomised a former male aide, a case he says was fabricated by the government.

Thursday's result marks the second time that Wan Azizah, 62, has stepped in for her husband during his controversial imprisonments. There was no immediate statement from her.

She won the same seat in 1999, replacing Anwar after her husband was sacked as deputy prime minister in Malaysia's long-ruling government and jailed on previous sodomy and corruption charges widely considered politically motivated.

That imprisonment left Wan Azizah at the head of the reform movement that emerged in response to Anwar's ouster, and she twice defended the seat.

But she vacated it in 2008 to allow Anwar to return to parliament after his release.

Genuine challenge 

Taking over leadership of the opposition, he helped inspire a once-fragmented opposition to unprecedented gains in parliament, nearly taking power in 2013 polls from the ruling coalition that has dominated Malaysia for decades.

The three-party opposition alliance - Pakatan Rakyat - made big gains in the 2013 election, which for the first time raised the prospect of a genuine challenge to the coalition that has ruled Malaysia since independence in 1957.

Anwar calls the sodomy case a conspiracy by Najib's government to derail the opposition's momentum.

Najib has been condemned at home and abroad over the Anwar case and for the arrests of scores of opposition politicians and other critics over the past year on sedition and other charges.

Source: Agencies