MANILA, July 6 (Reuters) - Three men belonging to a religious group linked to kidnap-for-ransom activities were shot dead when they tried to escape with six others during a jail riot in the southern Philippines, a prison official said on Friday. Alejandro Almazin said four men were immediately recaptured, including three who were shot in the hands and legs while fleeing near an abandoned cemetery at the back of the prison facility in Cagayan de Oro City on the island of Mindanao. Three prisoners were killed and two got away, Almazin said. The nine were facing charges ranging from murder to kidnapping. "The three prisoners were killed when they resisted arrest," said Almazin, adding the two men that got away were believed to have been injured when local police officers fired at them when they did not heed warning shots. Police said an assault rifle stolen from one of the guards was also recovered from one of the recaptured prisoners who was shot in the back. It was the second jailbreak from the prison. About 50 detainees escaped two years ago by climbing over a 4 metre-high wall at the facility. Across the country, nearly 100 prisoners escaped in 23 jail breaks from January to June this year, according to records at the Philippine National Police. In 2007, about 120 inmates fled in at least 36 cases of prison break out.