Prisoners set fire to a jail in Turkey's earthquake-hit city of Van on Tuesday and gunshots were heard as inmates fought their guards following a big aftershock.

A soldier said the prisoners, who feared they could be crushed to death in their cells, had attacked the guards with scissors and knives, two days after 200 people are reported to have escaped in the chaos after the original quake.

Reuters journalists saw flames at the building and white smoke billowing into the night sky, before half a dozen shots rang out to quell the shortlived revolt by prisoners, angry that they were being kept locked in cells while the building shook.

No more gunfire was heard in the following hours as more soldiers were bussed in to tackle the riot in Van, capital of a region inhabited mostly by Kurds.

Fire services put out the flames, while members of parliament from a pro-Kurdish party joined government officials and prison administrators talking to the prisoners.

Inmates naturally wanted to go out in the yard after the strong aftershock. They weren't allowed, there was chaos. We heard a fire was started, Aysel Tugluk, one of the MPs, told Reuters before going into the prison to join talks.

Several hours later her colleague, Nazmi Gur came back to tell journalists the riot was over and there were no casualties -- though one soldier was seen earlier being treated for cuts.

Earlier, police threw teargas canisters to disperse an angry crowd that had gathered outside the jail. Scuffles had broken out with police as the crowd swelled to more than 200, including some relatives of the inmates.

The 5.4 magnitude aftershock that frightened the prisoners shook the region just before 6 p.m. (1500 GMT), spreading panic among survivors in towns and villages hit by Sunday's quake.

Turkish media had reported that 200 prisoners had escaped on Sunday after the quake brought down a perimeter wall at the jail, but 50 returned after visiting relatives to check on their safety.

Deputy Prime Minister Besir Atalay, who is overseeing relief operations in Van, has said he was unsure how many inmates had escaped and how many had come back.

Officials played down the size of the jailbreak, saying the media reports were exaggerated.

Some inmates went out of the prison yard after the wall collapsed to see their families, and they returned after seeing them, Prison and Correctional Facilities General Manager Sefa Mermerci told the state-run news agency Anatolian.

He also denied that any Kurdish militants were among the inmates. Van has largely escaped the worst of a long running Kurdish separatist insurgency that has afflicted the southeast of Turkey.

There are no prisoners serving time for terrorism crimes in this prison. This is a prison for ordinary crimes and criminals, Mermerci said.

(Writing by Simon Cameron-Moore; editing by David Stamp)