Puerto Rico's justice secretary, Wanda Vazquez, became governor on Wednesday, just hours after the island's Supreme Court declared the swearing-in of her predecessor Pedro Pierluisi unconstitutional.

Vazquez is the second woman to hold the highest office in Puerto Rico and her ascent to power comes after weeks of turmoil in the island.

"I will continue to focus on helping our people regain their way in an orderly and peaceful fashion," she said in a statement, adding that she promised to assume the position with "humility and commitment."

The island's political crisis was set off by leaked text chats from former governor Ricardo Rossello and 11 others of his staff making fun of women, gay people and victims of Hurricane Maria.

Residents in San Juan took to the streets for days demanding his resignation, which he ultimately acceded to last Friday.

But the problems did not end there. His successor, Pedro Pierluisi, became governor after Rossello appointed him secretary of state shortly before leaving office. The rules of succession indicate that after a governor resigns, the next in line is the secretary of state.

But the appointment took place while the Senate was not in session, and as a result, Supreme Court justices ruled that Pierluisi's assumption of power was unconstitutional, since he had not been confirmed by the Senate.

Read more: Popular will topples Puerto Rico's Rossello

Pierluisi called for unity and for Puerto Ricans to discard their "political-partisan, ideological or personal agendas," as he stepped down from his brief tenure.

"When I assumed the position of governor last Friday, I did it based on the express language of Puerto Rico's Constitution and the law in force at that time," Pierluisi said in a statement, adding that he acted under laws that "are presumed constitutional, and therefore valid."

Rossello, Pierluisi and Vazquez are all members of the same political party, the New Progressive Party (PNP).

Many Puerto Ricans who took part in the protest movement against Rossello also oppose Vazquez as governor, which could unleash a new wave of demonstrations.

For her part, Vazquez had publicly said she was not interested in the governorship, but she was nonetheless confirmed shortly after the court ruling.

Puerto Rico, a self-governing US territory, has been mired in a debt crisis and is still reeling from the devastating 2017 Hurricane Maria, which left some 3,000 people dead.

jcg/kl (AFP, AP)

Each evening at 1830 UTC, DW's editors send out a selection of the day's hard news and quality feature journalism. You can sign up to receive it directly here.