John Bacon, Kristin Lam and Jorge L. Ortiz | USA TODAY

USA TODAY

SAN JUAN – Puerto Rico Gov. Ricardo Rosselló resigned late Wednesday amid a torrent of protests over vulgar, mean-spirited texting conversations.

He said his resignation would be effective Aug. 2, making him the first governor to resign in the modern history of the U.S. territory, which is mired in a 13-year recession and still recovering from a Category 4 hurricane two years ago.

Justice Secretary Wanda Vázquez will become the new governor.

“The demands have been overwhelming and I’ve received them with highest degree of humility," Rosselló said in his announcement just before midnight local time.

Thousands of demonstrators awaited word of Rosselló's decision in Old San Juan, and they celebrated euphorically when he finally announced that he was stepping aside. Fireworks and chants of “Ricky renuncio” (Ricky resigned) greeted the much-desired announcement.

Even before Rosselló's message was posted on Facebook, a carnival-like atmosphere permeated in the cobble-stoned streets as people waved Puerto Rican flags and made noise any way they could, many by banging pots with metal spoons, others hitting cowbells.

Street vendors added to that vibe, hocking everything from flags to “Renuncia Ricky” T-shirts, beer, sangria, food and water.

“We couldn’t continue allowing politicians to abuse their power and use the police to repress people. This shows the courage and strength of people in Puerto Rico, especially the youth, which came out on the streets in large numbers," said Rafael Ojeda, 32, a cook. "There’s much more to fight for, and (Rossello) has lots more to pay for, but what I’m truly happy about is seeing all these people here. It’s an indescribable feeling.”

Migda Jimenez, 31, a social worker, told USA TODAY she felt a "sense of euphoria."

“As Puerto Ricans, we have awoken from a long slumber," Jimenez said. "We bounced back on our feet after Hurricane Maria. That brought out in us a sense of our nationality and inspired us to fight against injustice and corruption. We are reclaiming our right to have a clean government.”

Rosselló's resignation was celebrated on the mainland, too.

Thais Llorca, EPA-EFE

"This is democracy in action," 2020 Democratic presidential candidate Julian Castro tweeted early Thursday. "The Puerto Rican people demanded change and refused to accept anything less. The Governor has made the right decision."

Elizabeth Warren, another Democratic presidential candidate, tweeted her admiration for the people of the territory: "The people of Puerto Rico have endured so much—disaster and tragedy, economic crisis, government corruption, generations of disrespect. I'm inspired by my fellow U.S. citizens and their movement to hold their government accountable."

Two other presidential candidates, Bernie Sanders and Tulsi Gabbard, cited Rosselló's ouster as an example of the power of unity.

Braving the humidity and high temperatures in front of the Governor’s Mansion, known as La Fortaleza, a few hundred protesters were loud and clear in the afternoon. “Where is Ricky? Ricky is not here. Ricky is selling what’s left of the country,” many chanted. The crowd broke into a rendition of "Preciosa," an old ode to Puerto Rico.

“This is a historic moment," said Yomarili Rosa, 28, a librarian who was banging on a pot. "People have developed a new political awareness and become more knowledgeable about their power and ability to bring about change.”

Jorge L. Ortiz, USA TODAY

The festive gathering, featuring bongos and maracas to accompany the chanting, was modest compared with the massive protest Saturday, when tens of thousands of irate islanders marched to demand an end to Rosselló's reign. Rallies have taken place daily since the texts became public two weeks ago.

Rosselló isn't the first official to resign in the fallout. Former Secretary of State Luis Rivera Marín, one of Rosselló's closest associates, resigned July 13 after the leak of 889 pages of private messages on Telegram between the governor and high-ranking officials.

A judge issued search warrants Tuesday for the cellphones of government officials tied to the two-week scandal. There were other resignations and hints that criminal charges could follow. Rosselló chief of staff Ricardo Llerandi quit Tuesday, citing threats to his family.

Rosselló resigned the presidency of his political party a few days ago, announcing that he would not run in next year's gubernatorial election. His place at the head of the New Progressive Party, the island's most influential, will be taken by Senate President Thomas Rivera Schatz.

"To those who vote for our party, your trust and support is our most valuable asset," Schatz said in statement. "We will do our part to never let them down. We are counting on all of you."

View | 46 Photos

Puerto Rican Gov. Ricardo Rosselló resigns

Angel Martinez, 40, an information systems technician, said the chat scandal "opened Pandora's box" and gave people a look at who their leaders really are.

"They present themselves one way, but we got to see what they’re really like when people were not looking," he said. "They disrespected the country. And making fun of the people who died because of Maria was despicable.”

Rosselló, a young family man and son of a former governor, took office less than three years ago to much excitement. The territory was saddled in debt, and the devastation of Hurricane Maria less than a year into his term added to the strain on his government.

He was criticized for understating the death toll from the hurricane, and the recovery effort struggled. He drew fire for failing to challenge President Donald Trump's behavior when he visited the island, behavior many Puerto Ricans viewed as arrogant and dismissive.

More recently, charges of political corruption within the government began to emerge. The texts were the final straw, Carlos A. Suárez Carrasquillo, a Puerto Rico native who lectures on Latin American at the University of Florida, told USA TODAY.

"The final blow to his legacy came in the aftermath of the Telegram chats where his – and his staff’s – disparaging words against Puerto Ricans from all walks of life, a public policy of targeting political enemies," he said. "And his unwillingness to hear the demands of the people make his case remarkable."

Bacon reported from McLean, Virginia; Lam reported from Los Angeles.