Justice Secretary Wanda Vázquez has been sworn in as Puerto Rico's latest governor, hours after the island's Supreme Court overturned the swearing in of Pedro Pierluisi as governor. The unanimous ruling said Pierluisi must step aside immediately.

The high court's decision, which cannot be appealed, was expected to unleash new demonstrations and deepen the tumult because many Puerto Ricans have said they don't want Vázquez as governor.

"It is concluded that the swearing in as governor by Hon. Pedro R. Pierluisi Urrutia, named secretary of state in recess, is unconstitutional," the court said in a brief statement.

Get Breaking News Delivered to Your Inbox

Pierluisi said previously he would respect whatever ruling was made. Shortly after it was announced, someone yelled through a loudspeaker near the governor's mansion: "Pierluisi out! The constitution of Puerto Rico should be respected!"

Pierluisi was appointed secretary of state by then-Gov. Ricardo Rosselló while legislators were in recess, and only the House approved his nomination. Pierluisi was then sworn in as governor Friday after Rosselló formally resigned in response to angry street protests.

People march in protest in San Juan on July 29, 2019. Getty

Puerto Rico's Senate sued to challenge Pierluisi's legitimacy as governor, arguing that its approval was also necessary, and the Supreme Court held in favor of the Senate.

On Monday the Senate decided not to hold a vote although the body's president, Thomas Rivera Schatz, said Pierluisi had only five of 15 required votes. The same day the Supreme court announced it would hear the case.

The Senate had also asked the court to declare unconstitutional a portion of a 2005 law saying a secretary of state need not be approved by both House and Senate if they have to step in as governor. Puerto Rico's constitution says a secretary of state has to be approved by both chambers.

The court agreed that the clause was unconstitutional.

Six of its nine judges were appointed by governors from Pierluisi's party, the pro-statehood New Progressive Party, and three by the main opposition Popular Democratic Party. The senator leading the challenge to Pierluisi is in his party.

Justice Secretary Wanda Vázquez seen Feb. 4, 2019. AP

Vázquez became justice secretary in January 2017 and has limited experience leading government agencies. She previously worked as a district attorney for two decades at Puerto Rico's justice department, handling domestic and sexual abuse cases, and in 2010 was appointed director of the Office for Women's Rights.

Some critics say that as justice secretary she was not aggressive enough in pursuing corruption investigations involving members of her New Progressive Party, and that she did not prioritize gender violence cases.

Last November, the Office of Government Ethics said it had received a complaint about possible ethical violations involving Vázquez, who was accused of intervening in a case involving a suspect charged with stealing government property at a home where Vázquez's daughter lived.

Vázquez appeared in court to face charges including two violations of a government ethics law. In December a judge found there was no evidence to arrest her.

Rosselló's resignation followed nearly two weeks of protests amid anger over corruption, mismanagement of funds and a leaked obscenity-laced chat in which he and 11 other men including government officials mocked women, gay people and victims of Hurricane Maria, among others.

More than two dozen officials resigned in the wake of the leak, including former Secretary of State Luis Rivera Marín.