SAN JUAN, Puerto Rico — Puerto Rico Gov. Ricardo Rosselló says he is resigning effective Aug. 2 in the face of public furor over an obscenity-laced online chat that showed the governor and close advisers insulting women and mocking constituents including the victims of Hurricane Maria.

The 40-year-old Rosselló is the first governor to resign in the modern history of Puerto Rico, a territory of 3.2 million U.S. citizens that is mired in a 13-year recession and still recovering from the Category 4 hurricane two years ago.

Public outrage over the leaked chats and federal corruption charges against former government officials sparked massive demonstrations across San Juan in the largest protest movement on the island since Puerto Ricans successfully marched to demand an end to U.S. Navy military training on the island of Vieques more than 15 years ago.

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