A mutiny at a Brazilian prison that left two people dead ended Monday after negotiations between inmates and the warden.

The rebellious inmates surrendered at 8:20 a.m., releasing the 68 visitors they were holding hostage inside the penitentiary in Itirapina, a town about 200 kilometers (120 miles) from Sao Paulo city.

Police entered the prison to re-establish order and conduct a headcount of the 602 inmates, the Sao Paulo state government said.

The Itirapina penitentiary was built to hold 210 prisoners.

The trouble began shortly before midday Sunday with a clash between rival inmate factions, the state prisons service said, without offering any details about the two prisoners' deaths.

The 68 people, including children, who had entered the prison to visit jailed family members were prevented from leaving, according to the prisons service.

Authorities did not say whether the warden made any concessions to the rebellious inmates, whose list of grievances included complaints that visiting family members were harassed by guards.