Ricardo Rosselló has resigned as the governor of Puerto Rico and a former congressman has been sworn in as his replacement, but experts say that the Puerto Rican Supreme Court may ultimately weigh in on the succession.

Rosselló stepped down after mass protests following allegations of rampant corruption in his administration and a scandal over leaked chat messages in which he and advisers seemed to express contempt for a swathe of Puerto Ricans.

On Wednesday, Rosselló named longtime politician Pedro Pierluisi as the Secretary of State, who would ordinarily be next to be governor. Pierluisi was sworn in as governor at around 5 p.m. on Friday.

Experts say, however, that Pierluisi is likely to face legal challenges in the coming days.

Pierluisi was confirmed as the Secretary of State only by the Puerto Rican House of Representatives— and not the Senate, which is not expected to take up a vote on Pierluisi’s confirmation until Monday. Officials are divided as to whether confirmatiton in both legislative chambers is necessary.

Pierluisi said in a statement that he will only serve as governor until the Senate decides on his nomination; if not confirmed, he said he would hand over the position to the official next in the line of succession – Justice Secretary Wanda Vázquez.

It’s uncertain, however, whether Vázquez would keep the job. She has indicated that she does not want the position, and embroiled in her own controversies.

Thomas Rivera Schatz, the president of the senate and the new chairman of Puerto Rico’s New Progressive Party, has also indicated that he wants to be governor himself.

Bloomberg—Bloomberg via Getty Images

Bloomberg—Bloomberg via Getty ImagesPedro Pierluisi, nominee for Puerto Rico secretary of state, swears in to a confirmation hearing at the House of Representatives, in San Juan, Puerto Rico, on Friday, Aug. 2, 2019. Many legislators oppose Pierluisi because of his ties to a federal fiscal oversight board. If the House rejects him, his nomination would die..

José Rámón Sánchez, a professor of political science at Long Island University-Brooklyn, tells TIME that a “constitutional crisis” is a possibility before a new governor is sworn in.

“Ultimately, the people are going to determine what’s going to happen,” Sánchez says. “People don’t know much about these characters who are trying to maneuver themselves into positions to become governor — [or] even acting governor. But it’s clear that people have reached a point where they no longer have much trust for the government itself.”

Puerto Rico has been thrown into upheaval in the aftermath of the 2008 recession, Hurricane Maria, and the privatization of the public sector on the island, Charles R. Venator Santiago, an associate professor of political science at the University of Connecticut, tells TIME. Venator says that the growing sense that the governor is “part of the corruption” was the “tipping point” for the public.

“People are irate that private companies are profiting while the average person is in crisis,” says Venator Santiago. “There is a material fiscal crisis affecting all of us.”

Thomas Rivera Schatz, president of the Senate of Puerto Rico, speaks during a special session of the Legislative Assembly at the Capitol building in San Juan, Puerto Rico, on Thursday, Aug. 1, 2019. Embattled Puerto Rico Governor Ricardo Rossello's nomination of his successor is heading into crucial last-minute votes amid doubts that lawmakers will confirm his pick, creating a potential leadership void for the bankrupt island. Bloomberg—Bloomberg via Getty Images

Puerto Rican activist Julio López Varona, who works as an organizer for the New York-based Center for Popular Democracy––one of the groups behind the mass protests calling for Rosselló’s resignation — says Thursday’s hearings further illustrate the dysfunction within the Puerto Rican government.

“I think our anger has turned into frustration,” he tells TIME. “People were in the streets for two weeks and in many ways what they were asking for was more democracy––the ability to have a say in our future. But unfortunately we’ve seen… the status quo is holding on to their power and not listening to what the people are asking for and it’s disheartening.”

Last month, Rosselló bowed to mounting public pressure following mass protests demanding his resignation after corruption charges against members of his government and the release of chat messages that included him and members of his administration make crude remarks and jokes about victims of Hurricane Maria.

Pierluisi narrowly lost to Rosselló during the 2016 primary election.

Pierluisi served in the U.S. Congress as a non-voting resident commissioner from 2009-2017. During his time in Congress, he helped secure federal stimulus funds and ensured Puerto Ricans were covered by Obamacare, the New York Times reports.

The 60-year-old then retired from politics and began working for the O’Neill & Borges law firm. His work there has been seen by many as a huge conflict of interest because the firm represented the Financial Oversight and Management Board for Puerto Rico, as well as because the board was also run by his brother-in-law, José B. Carrión III.

The board––which was created in 2016 to help deal with the island’s financial crisis––is unpopular among with Puerto Ricans.. On Tuesday Pierluisi announced he has taken a leave of absence from the firm.

López Varona believes that Thursday’s hearings were the result of an internal power struggle between Rosselló and Rivera Schatz. He says that Pierluisi concerns some members of the protest movement because of his deep ties to Wall Street. He said many protestors view Rivera Schatz as power-hungry and see the move to block Pierluisi as an attempt to secure his own position in the 2020 governor’s race.

Most protestors, López Varona says, ultimately just want a governor who will put the people’s interest first, and who it does not matter as much. “I think no one will be happy,” he says.

“We understand we are living under a political party that has not served its purpose. What community groups are saying is we don’t care who is at the helm, whoever it is won’t be great, but we do have some demands for who is there, what we really want to focus on for next year and a half is that the governor is being held accountable by the people.”

Correction, Aug. 2

The original version of this story misstated the first name of Puerto Rico’s resigning governor. It is Ricardo, not Ricard.

Write to Gina Martinez at gina.martinez@time.com.