MEXICO CITY — A medical student was fatally shot on Thursday on the campus of the Dominican Republic’s largest public university during a violent confrontation between the police and protesters angry about a new law that will significantly raise sales taxes and a proposal to privatize the school.

Witnesses said the student — identified by the authorities as William Florian Ramírez, 21 — was not taking part in the protest on the campus of the school, the Autonomous University of Santo Domingo, which has about 180,000 students, but he seemed to have simply been caught nearby. The demonstration, involving hundreds of people, had suddenly turned more hostile when young men in masks began throwing rocks at the police.

“He was shot in the back,” said Daphne Valera, who said she saw the shooting. “It was around 1 p.m. He was just standing there in the street on campus.”

A police spokesman in Santo Domingo said the shooting was under investigation. By early afternoon, classes had been suspended. Student leaders condemned both the rock throwing and the police response, but they said that they did not expect public anger to subside. An array of civic groups took part in protests all over the country, expressing outrage about the tax increases that they said were the product of corruption by the country’s former president, Leonel Fernández, and his party, which controls both houses of the legislature.