Gunfire erupted at a Venezuelan prison on Tuesday, prompting National Guard troops to use tear gas as they sought to take back control from armed inmates.

Venezuela's government is trying to close La Planta prison, following two escape attempts and complaints of overcrowding, saying the facility doesn't meet standards. Half the prison's inmates have already been transferred to other lockups.

Top prisons official Iris Varela said Tuesday that a small group of inmates has been resisting being transferred. She said several shots were fired from inside the prison.

Dozens of troops in anti-riot gear gathered outside, and clouds of tear gas floated in the air over the prison.

Hundreds of prisoners' relatives, worried by the gunfire, stood outside. Some of them wept.

Varela appealed for calm. She urged the resisting inmates to "give up their violent attitude, listen to their relatives."

"We know there are some who are resisting the evacuation," Varela said on state television. "However, they aren't right to be acting in that violent way."

She said one vehicle used by authorities was hit by a bullet.

However, no one was hurt, said Reinaldo Rangel, a national prisons administrator.

Some of the inmates' relatives outside the prison hurled rocks and other objects at the National Guard troops, who responded by using tear gas. Firefighters said at least eight people received medical help after inhaling tear gas.

Maria Escobar, whose brother is imprisoned, said relatives were rightly protesting out of concern that there could be clashes involving inmates and troops.

"If they go in there like this, there's going to be massacre," Escobar said.

The gunfire eventually died down, and Varela said the authorities would keep talking with the inmates to convince them to leave voluntarily and be transferred to other prisons.

She said that La Planta is unfit to hold "any human being."

Tensions have grown at the prison recently after what the authorities said were escape attempts. On April 27, Varela said the authorities foiled an escape attempt when they found a tunnel dug by inmates that led to a sewer. On April 30, gunfire erupted at the prison after what Varela described as another escape attempt.

Hundreds of inmates remain in the prison, and some of their relatives have said that a group of armed prisoners has been holding out saying they don't want to be taken to other prisons that have severe crowding problems and are far away from courts in Caracas that are handling their cases.

Venezuela's prisons were built to hold about 12,000 inmates, but officials have said they hold about 47,000.