Tensions erupted Saturday at the Anuradhapura prison when guards tried to control the riot. In the commotion, guards opened fire to prevent inmates from fleeing, police said.
Anuradhapura is about 200 kilometers (120 miles) north of Colombo.
Prisoners were complaining about the decision by the authorities not to allow visitors as a move to contain the virus.
Sri Lanka has imposed a three-day countrywide curfew since Friday as the number of cases has risen to 77.
On Sunday, a police statement said two inmates died and six others were being treated at a hospital.
Police said no inmates escaped and security at the prison has been strengthened with additional police teams, including commandos.
Senaka Perera, president of the Committee for Protecting Rights of Prisoners, said the inmates were protesting congested conditions and the poor quality of meals after the government banned visitors for two weeks to prevent the spread of the virus. Visitors often bring home-cooked food.
Sri Lanka's prisons are overcrowded, sometimes housing 5,000 inmates in a facility capable of holding 800, according to the pressure group.