A stomach bug has sickened 82 inmates at Allendale Correction Institution in Fairfax, but the worst appears to be over, a state prison spokesman said Thursday.

During the wave of gastrointestinal sickness, which began Aug. 25, all 1,232 inmates were locked in their cells to prevent the contagion from spreading. Food and medications were brought to them.

The lockdown ended Wednesday for most inmates, but two inmates who still showed symptoms remained in their cells, said spokesman Josh Gelinas.

Symptoms included diarrhea and cramps, he said. The sickness lasted in each person from 48 hours to 72 hours.

Before taking action, the Corrections Department consulted with the S.C. Department of Health and Environmental Control. DHEC has experts in contagious diseases.

No corrections officers at the medium-security prison were known to have been infected.

Inmates were treated with Kaopectate, Tylenol, Imodium and "lots of fluids," Gelinas said.

Stomach bugs are spread mostly through close contact with other people, according to the federal Center for Disease Control and Prevention.