SAN JUAN, Puerto Rico (AP) – Puerto Rico Gov. Ricardo Rosselló has announced he will resign Aug. 2, conceding power after nearly two weeks of furious protests and political upheaval touched off by a leak of crude and insulting chat messages between him and his top advisers.

A crowd of thousands outside the governor’s mansion erupted into cheers and singing after Rosselló’s announcement on Facebook just before midnight.

The 40-year-old son of a former governor, Rosselló became the first chief executive to resign in the modern history of Puerto Rico, a U.S. territory of more than 3 million American citizens without full representation in Congress or the right to vote for president.

Justice Secretary Wanda Vázquez will assume the post less than halfway through Rosselló’s four-year term, becoming Puerto Rico’s second female governor.

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