The first woman elected prime minister of Samoa showed up for her swearing-in ceremony on Monday to find her opponents had locked the doors to prevent her from taking office.

Fiame Naomi Mata’afa and her followers pitched a tent on the statehouse lawn, where she took the oath of office instead.

The bizarre scenes capped six weeks of election turmoil that escalated into a constitutional crisis over the weekend as Mata’afa’s fierce rival refused to cede power.

“This is an illegal takeover of government,” Mata’afa said Sunday of the efforts to keep her from office. “Because it’s a bloodless coup, people aren’t so concerned or disturbed by it.”

The drama in the Pacific nation of 200,000 could have broader geopolitical ramifications. Mata’afa has pledged to stop a $100 million port development backed by China, which has been expanding its regional influence.

The standoff began April 9 when a national election ended in a 25-25 tie between Mata’afa’s newly created FAST Party and the ruling Human Rights Protection (HRP) Party, headed by Tuilaepa Sailele Malielegaoi, the prime minister since 1998.

The deadlock appeared to have broken when a lone independent lawmaker sided with Mata’afa, only for the electoral commission to appoint another HRP candidate, citing gender quotas. That restored the tie.

Samoa’s head of state — an ally of Malielegaoi— announced new elections to resolve the standoff. But Mata’afa’s party appealed and last week the Supreme Court ruled in her favor, annulling the appointment, canceling the new election and clearing the way for her to take office, according to the Associated Press.

Monday marked the deadline for the new parliament to be seated.

But on Saturday night, head of state Tuimaleali’ifano Va’aleto’a Sualauvi II canceled the seating without explanation, Radio New Zealand reported. When the Supreme Court overruled him on Sunday, the house speaker — another Malielegaoi ally — postponed the opening of parliament.

That led to Mata’afa’s claim that a “bloodless coup” was underway.

“We have to fight this because we want to retain this country as a country that is democratically ruled, premised on the rule of law,” she told New Zealand’s Newshub on Sunday.

When she arrived at the circular parliament house on Monday accompanied by the chief justice — dressed in a ceremonial wig and robes — who would swear her in, however, Mata’afa found the doors locked tight. The clerk of the house told her the building had been locked on the orders of Malielegaoi and the speaker.

Mata’afa asked him to open up anyway.

“We need brave Samoans right now,” she said, according to the Guardian. “Return the power to the hands of the people.”

But the doors stayed locked, and police refused to intervene.

As Mata’afa and her supporters gathered under a large white tent on the parliament lawn, her opponent held a news conference to accuse her of “breaking and entering.”

“They have desecrated the grounds of parliament, and have made a ruckus in our hallowed grounds, they are trying to use force to open the House of Parliament,” Malielegaoi said, the Guardian reported.

A few hours later, Samoans found themselves faced with two prime ministers when Mata’afa was sworn in during an ad hoc outdoor ceremony.

As onlookers fanned themselves in the afternoon heat, Mata’afa took the oath of office to loud applause.

But the ceremony appeared to add to Samoa’s constitutional crisis, with experts saying the situation was unprecedented since independence in 1962.

“Samoa is a young democracy,” said Iati Iati from Victoria University of Wellington. “What you have then is a number of institutions whose power has not been accurately defined, so you have the head of state pushing the limits of his power, you’ve got the speaker coming in with his, you’ve got the courts asserting their power and you’ve got the prime minister saying he won’t listen to the courts.”

The crisis could get worse before it’s resolved.

“With apparently two governments, you would imagine that tensions could be brought to a boiling point very soon,” Iati said.

International leaders appeared reticent to take sides on Monday.

“We have faith in Samoa’s democracy and in their institutions,” said New Zealand Prime Minister Jacinda Ardern, while Australian Foreign Minister Marise Payne urged “all parties [to] respect the rule of law and democratic processes.”

Mata’afa was a member of Malielegaoi’s party until she broke away last year, criticizing — among other things — his plan for a Chinese-funded wharf.

She has said she will continue close relations with Beijing, but does not want to add to the more than $150 million Samoa already owes China.

Malielegaoi sought to dispel his rival’s swearing-in as “a joke.”

“Oh my, where have we ever seen a Speaker sworn in, in a tent? Shameful,” he said, according to Radio New Zealand.