SAN JUAN, Puerto Rico (AP) — Justice Secretary Wanda Vázquez became Puerto Rico's new governor Wednesday, just the second woman to hold the office, after weeks of political turmoil and hours after the island's Supreme Court declared Pedro Pierluisi's swearing-in a week ago unconstitutional.

Accompanied by her husband, Judge Jorge Díaz, and her daughter, Vázquez took the oath of office in the early evening at the Supreme Court before leaving without making any public comment.

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

The high court's unanimous decision, which could not be appealed, settled the dispute over who will lead the U.S. territory after its political establishment was knocked off balance by big street protests spawned by anger over corruption, mismanagement of funds and a leaked obscenity-laced chat that forced the previous governor and several top aides to resign.

But it was also expected to unleash a new wave of demonstrations 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.

Pierluisi said that he had stepped forward to help islanders "in the best good faith and desire to contribute to the future of our homeland," but that he would respect the court's ruling.

"I must step aside and support the Justice Secretary of Puerto Rico, the Honorable Wanda Vázquez Garced," he said in a statement before she was sworn in.

People began cheering in some parts of San Juan after the ruling was announced.

But late in the day, about two dozen protesters gathered outside the governor's mansion and called for the removal of Vázquez.

"There'll be no peace as long as there's impunity," yelled the crowd, which remained calm as curious onlookers including tourists took pictures and video.

Carmen Santiago, a homemaker from San Juan who joined the protest, said Puerto Ricans still have energy to organize more protests.

"Especially the young people," she said. "It should be the people who choose the governor, not the party."

But many Puerto Ricans are physically and emotionally exhausted and want an end to the political turmoil, said Xiomary Morales, a waitress and student who works a block away.

She praised the court's decision, saying that those in power "are used to doing what they want."

"They should just hold fresh elections, hit restart like a PlayStation game," Morales said.

Tita Caraballo, a retired nurse from the inland eastern city of Gurabo, disagreed with the court.

"I think they are playing with the people and, I don't know, maybe they have someone they want and that is why they are doing this," Caraballo said.

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 the protests.

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

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 law's clause was unconstitutional.

"Today this Tribunal speaks with a single voice, loud and clear," Justice Roberto Feliberti Cintrón said in his written opinion. "The constitutional norms do not allow for absurdities and legal technicalities to contravene our Democratic System of Government."

In a separate opinion, Justice Erick Kolthoff Caraballo said Puerto Rico has suffered upheaval "like never in its modern history" and "the People need calm and security that things will soon return to order."

Senate President Thomas Rivera Schatz praised the court ruling in a triumphant statement.

"With absolute LEGITIMACY, we will seek TRUE PEACE and STABILITY," he said.

Six of the court's nine judges were appointed by governors from the pro-statehood New Progressive Party, to which both Pierluisi and Rivera Schatz belong.

Vázquez, a 59-year-old former prosecutor, is to serve out the remainder of Rosselló's term, with the next election scheduled for 2020.

Vázquez became justice secretary in January 2017. 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 that 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.

William Gónzalez Roman, a retiree also from Gurabo, wasn't bullish on the idea of Vázquez as governor.

"We will see. You have to give everyone a chance, right?" González said. "Let's see what decisions (she makes), but I tell you that job is big with a lot of responsibility."

Rosselló's resignation followed nearly two weeks of protests after the public emergence of the 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.

"NOW is when that detestable group from the chat that lied, mocked, machinated, conspired, violated the law and betrayed Puerto Rico is truly ended and will leave government," Rivera Schatz, the Senate president, said Wednesday.

___

Associated Press writer Mariela Santos contributed to this report.

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