WELLINGTON, New Zealand (AP) — Samoa appeared set to get its first woman leader after the nation's top court on Monday reinstated the results of a knife-edge election last month.

Two decisions by the Supreme Court have paved the way for Fiame Naomi Mata’afa to become prime minister of the small island nation.

Her ascent is a milestone for the South Pacific, which has had few female leaders. Samoa and its neighbors tend to be Christian and traditional.

An advocate for women's equality, Fiame, who was born in 1957, broke new ground during her campaign by going on the road and robustly criticizing the incumbent, Prime Minister Tuilaepa Sailele Malielegaoi, who had been in power for 22 years.

The court's decisions appeared to end what most people viewed as an attempt by Tuilaepa to cling to power. Fiame had served as his deputy before they had a bitter split.

“Glory to our Father!” Fiame's FAST Party wrote on Facebook after the court’s decisions. “Now its time to get to work.”

The April election initially ended in a 25-25 tie between the FAST Party and Tuilaepa’s HRP Party, with one independent candidate.

But then the electoral commissioner appointed another HRP candidate, saying it was required to conform to gender quotas. The independent candidate, meanwhile, chose to go with Fiame, making it 26-26.

The head of state then stepped in to announce fresh elections to break the tie. Those elections in the nation of 200,000 were supposed to be held later this week.

Fiame's party appealed and the Supreme Court finally ruled against both the appointed candidate and the plans for the new elections, restoring the FAST Party to a 26-25 majority.

Dozens of her supporters gathered outside the court and celebrated with singing after the decision.

Fiame wrote on Facebook that while people remained confused about what had happened, she believed the incumbent government used every means, both legal and illegal, in an attempt “to stop us from taking our rightful seats in Parliament and to form the government."

With the court ruling paving the way for Fiame to lead Samoa, New Zealand Prime Minister Jacinda Ardern said it felt like a significant moment.

“It is certainly a meaningful thing when you see a historic decision made when the office is held by a woman,” Ardern said.

Copyright 2021 The Associated Press. All rights reserved. This material may not be published, broadcast, rewritten or redistributed without permission.