SAN JUAN, P.R. — Thousands of demonstrators joined a general strike in the capital of Puerto Rico on Tuesday that ended in mayhem after the police fired tear gas and pepper spray to end a tense standoff with some of the protesters.

The demonstrators gathered to oppose school closings, university tuition increases and potential cuts to pensions and other benefits. As the island rebuilds in the wake of Hurricane Maria, which devastated the economy and prompted an exodus of Puerto Ricans left with few options, the protesters said they feared that looming austerity measures would decimate what remained of the island’s middle class and force even more residents to leave.

“We’re overwhelmed,” said Carlos Cofiño, a 20-year-old political science student, as he prepared to march. “We need to express our indignation and let the government know that there are people who are suffering.”