Puerto Rico's Governor Ricardo Rosselló has announced his resignation after days of mass street protests in the US territory.
Mr Rosselló, who had only on Sunday insisted he would stay on, said he would continue working until 2 August to allow an orderly transition.
He has been at the centre of a group text message scandal that has already led two top officials to resign.
The leaked messages revealed sexist, profane and homophobic comments.
The chat, which contained 880 pages of exchanges between the governor and 11 male allies, was leaked on 13 July and led to days of protests outside the governor's mansion in San Juan.
Hundreds of thousands of people took to the streets again on Monday, repeating their calls for his resignation.
The 40-year-old governor is leader of the New Progressive Party, a Puerto Rican political party which advocates US statehood.
Reports said he was likely to be replaced by the US Caribbean island territory's Secretary for Justice, Wanda Vazquez.
On Sunday, in an attempt to appease protesters, he said he would not seek re-election next year.
"I hear you," Mr Rosselló said in a Facebook video. "I have made mistakes and I have apologised."
"I know that apologising is not enough," he also said. "A significant sector of the population has been protesting for days. I'm aware of the dissatisfaction and discomfort they feel. Only my work will help restore the trust of these sectors."
What was in the texts
Several of the texts mock victims of Hurricane Maria, which devastated the island in 2017 and may have led to more than 4,000 deaths.
In one instance, Mr Rosselló criticised the former speaker of the New York City Council, Melissa Mark-Viverito, saying people should "beat up that whore".
When the island's chief fiscal office wrote that he was "salivating to shoot" the mayor of San Juan, Mr Rosselló replied: "You'd be doing me a grand favour."
Local newspaper El Nuevo Día called on the governor to resign in its Monday editorial.
"Puerto Rico has spoken up, not only as a strong, broad and united voice, but as the right voice," the editorial said. "With a gesture of nobility and humility, Governor, it is time to listen to the people. You have to resign."
San Juan Mayor Carmen Yulin Cruz said in a Twitter message on Monday: "They can't deny it: The power is in the street."
Singer Ricky Martin, who was targeted in the secret messages, was among those calling for the governor to resign, as well as Hamilton creator Lin-Manuel Miranda and reggaeton star Bad Bunny.
"They mocked our dead, they mocked women, they mocked the LGBT community, they made fun of people with physical and mental disabilities, they made fun of obesity. It's enough. This cannot be," Martin said in a video on Twitter.
The island's political crisis also made headlines throughout mainland US. Many echoed the New York Times editorial board, which wrote that the "callousness and partisan self-dealing" exposed by the messages serve as exorbitant strain for the long-suffering island, effectively "rubbing salt into a long-festering wound".
"The Puerto Rican people have no use for petty political feuding," the New York Times wrote. "Their territory is struggling under the weight of government corruption, incompetence and indifference. Having been failed by their leaders at every level, they are out of patience. They deserve better."
US President Donald Trump has also called on the governor to resign.