Image copyright Reuters Image caption The messages between Ricardo Rosselló and his team were sexist, homophobic and profane

Puerto Rico Governor Ricardo Rosselló has said he won't stand for re-election next year, after more than a week of protests calling for his resignation.

A trove of sexist, homophobic and other profane messages between Mr Rosselló and his team were published on 13 July.

The chats also included derogatory references to singer Ricky Martin's sexuality, and offensive comments about the survivors of Hurricane Maria.

Mr Rosselló apologised but has refused to step down before his term ends.

The governor, whose term will end in January 2021, said he would also stand down as head of his New Progressive Party.

"I have made mistakes and I have apologised," he said in a video posted on Facebook. "I admit that apologising is not enough. In this case, I announce that I will not seek reelection as governor next year."

Image copyright Getty Images Image caption Protesters in San Juan have been demanding Mr Rosselló resign

Since the messages were published huge crowds have been gathering in Puerto Rico's capital San Juan, and solidarity demonstrations have been held in other cities such as New York.

Protesters also say they have had enough of corruption in the US island territory and have criticised the recovery efforts following Hurricane Maria in 2017.

Two former top government officials from Mr Rosselló's administration were among a group arrested a week before the messages were published, and charged with conspiracy and fraud involving millions of dollars in federal funding.

What is the scandal about?

The messages, obtained by Puerto Rico's Centre for Investigative Journalism, fill almost 900 pages. They were from a group chat on the encrypted messaging app Telegram that included the governor and 11 of his aides and cabinet members.

The messages included jokes about Hurricane Maria victims, along with sexist and homophobic comments.

The official death toll stands at nearly 3,000, but a Harvard estimate puts the toll at more than 4,600.

You may also like:

In one conversation, Christian Sobrino, then chief fiscal officer of Puerto Rico says he is "salivating to shoot" San Juan Mayor Carmen Yulín Cruz. Ms Cruz has criticised the governor in the past.

Mr Rosselló replies: "You'd be doing me a grand favour."

Another message from Mr Sobrino described singer Ricky Martin as a "male chauvinist" before referencing his sexuality in vulgar terms.

What was the response?

Mr Sobrino and Secretary of State Luis Rivera Marin resigned following the leak.

A statement from White House spokesman Judd Deere said that the events "prove the president's concerns about mismanagement, politicisation and corruption have been valid".

Major figures have come out in support of the protesters. Ricky Martin led a protest to the governor's house last Wednesday.

Media playback is unsupported on your device Media caption Ricky Martin gave his support to Puerto Rican protesters

The singer said in a video on Twitter: "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."

Hamilton creator Lin-Manuel Miranda shared images of the protests in Puerto Rico online, and attended a solidarity demonstration in New York.

Reggaeton artist Bad Bunny stopped his European tour last week to return to Puerto Rico and protest. He praised the "bravery" of people on the island.