SAN JUAN (Reuters) - Two of Puerto Rico’s top government officials resigned on Saturday following the publication of a bombshell group chat in which Governor Ricardo Rossello and his closest allies exchanged controversial messages that have led to widespread calls for Rossello to also step down.

The political turmoil comes at a critical stage in the U.S. commonwealth’s historic bankruptcy and as its officials seek billions of dollars in funding from the federal government for healthcare and for recovery efforts following devastating hurricanes in 2017.

It also follows a 32-count federal indictment and arrests on Wednesday of six people, including two former high-ranking Puerto Rico government officials, who were charged with conspiracy and other crimes in connection with millions of dollars in federal Medicaid and education funds.

Two of the 12-member group chat - Secretary of State Luis Rivera Marin and Christian Sobrino, the island’s chief financial officer and Rossello’s representative on Puerto Rico’s federally created fiscal oversight board - left the government following Saturday’s release by Puerto Rico journalist group Centro de Periodismo Investigativo of 889 pages of text messages.

They show how Rossello and his closest advisors, including former and current public officials, public relations operatives and the governor’s former campaign manager, exchanged memes, derogatory, misogynistic and homophobic comments, as well as jokes about journalists, politicians and activists in a Telegram group chat. The messages further include public policy discussions, sharing of confidential government information and political campaign work, despite the presence of individuals who were not public officials at the time.

Calls for Rossello to resign have come from local politicians, including from the administration’s own political party, and U.S. Representative Raul Grijalva, an Arizona Democrat who chairs the House Natural Resources Committee, which oversees U.S. territories.

Activist groups and Puerto Rican celebrities such as Ricky Martin and Bad Bunny have also called for the governor’s immediate resignation.

So far Rossello, who had planned to run for a second term in the November 2020 election, has resisted the calls.

“I was elected by the people and I will continue the mission that was granted to me, now more than ever,” the governor said in a statement.

He added that a successor for Sobrino will be announced “within hours.” It was unclear when a successor would be named for secretary of state, a position that is second in charge of the government, according to Puerto Rico’s Constitution.

Puerto Rico filed a form of bankruptcy in 2017 to restructure about $120 billion of debt and pension obligations. Its oversight board, which has been feuding with Roswell over spending priorities, is expected to soon unveil a proposed plan of adjustment for the island’s core government debt, which includes a more than $50 billion unfunded pension liability.

Reporting By Luis Valentin Ortiz in San Juan, Additional reporting by Karen Pierog in Chicago; Editing by Andrea Ricci