Puerto Rico Gov. Ricardo Rosselló late Wednesday announced he would resign following days of massive protests calling for his ouster, according to NBC News.

Rosselló most recently came under fire for hundreds of leaked text messages between him and his top aides that contained homophobic and misogynistic slurs and contained jokes about the victims of Hurricane Maria, which devastated the island in 2017.

Rosselló made the announcement in a Facebook video.

ADVERTISEMENT

The Puerto Rico legislature earlier in the day had told the first-term governor they're ready to start impeachment proceedings unless he resigns first, NBC News reported. Attorneys reportedly determined there could be five offenses stemming from the leaked chats that constitute grounds for impeachment.

Rosselló had announced Sunday he would not seek reelection in 2020, but stopped short of stepping down and the promise did little to mollify the thousands who took to the streets this week.

Several 2020 Democratic presidential candidates and President Trump Donald John TrumpSteele Dossier sub-source was subject of FBI counterintelligence probe Pelosi slams Trump executive order on pre-existing conditions: It 'isn't worth the paper it's signed on' Trump 'no longer angry' at Romney because of Supreme Court stance MORE had also called on Rosselló to resign.

His resignation is effective Aug. 2, NBC reported.

CNN reports that Justice Secretary Wanda Vázquez will likely take Rosselló's place as governor.