Some of the 3562 inmates sleep on any space they can find in a classroom in Quezon city jail, Philippines. Credit:Kate Geraghty One prisoner stands watch, ready to wake those screaming nightmares. Prisoners take it in turns to sleep in every available space of the jail that was built to accommodate 323 but now houses 3539. I see six men crammed into a roof ceiling. One is curled up on a cupboard.

An inmate embraces a kitten as he rests in Quezon city jail. Credit:Kate Geraghty Dozens nap sitting up in a stairwell. Here another sleeps cuddling a kitten outside a cell accommodating 150 men, who have access to only two toilets. Quezon city jail has a congestion rate of 1181.30 per cent. Credit:Kate Geraghty If it doesn't rain hundreds of prisoners crawl on to an open-air basketball pitch, sleeping on cracked concrete on sacks or clothes, barely enough room to turn over.

Upstairs 87 prisoners suffering tuberculosis are isolated in one cell. They at least have a single television. Inmates go through their morning routine at Quezon city jail. Credit:Kate Geraghty Across the jail the air is stale with the smell of sweat and the stench from rotting garbage in a nearby canal. In August, three prisoners died of heatstroke during a power outage that stopped the jail's few electric fans. Prisoners sing and dance during an exercise routine at Quezon city jail. Credit:Kate Geraghty

The jail provides the equivalent of $1.35 to feed each prisoner, prompting the Philippine Daily Inquirer newspaper to suggest in an editorial that a sign be hung in all Philippine prisons declaring "please do not feed the animals" because prisoners are being kept in subhuman conditions like beasts. "Night-time is the worst. The inmates think about being separated from their families and the overcrowding makes conditions very harsh," says assistant jail warden Rosalin Carta. Prisoners sleep in a classroom in Quezon city jail. Credit:Kate Geraghty Human Rights Watch described the jail as straight out of Dante's "Purgatory", referring to the 13th century Italian writer's description of the realm where souls await judgement, while the French newsagency AFP described it as a "hell on earth". Philippine officials concede that conditions in overcrowded jails are "inhumane" and "unacceptable".

Mortuary workers carry the body of a summary execution victim on a stretcher in Manila. Credit:Getty Images More than 700,000 drugs suspects have surrendered since Mr Duterte, a 71-year-old former provincial mayor known as "The Punisher," issued shoot-on-sight orders to police in a drug crackdown that has left more than 3500 people dead. Thousands of Filipinos have subsequently ended up behind bars, pushing the capacity of jails and detention centres to breaking point. Quezon city jail is overflowing with people arrested during President Rodrigo Duterte's drug crackdown. Credit:Kate Geraghty But as Fairfax Media photographer Kate Geraghty and I walk among the prisoners in the Quezon jail, shortly after dawn, accompanied by a single female guard, I see some the same stoic acceptance of fate that I have witnessed in this disaster-prone country during times of heartbreak, such as typhoons or earthquakes.

When all appears lost there will be a smile and welcoming raising of eyebrows, among some of Asia's poorest people. Ruth-Jane Sombrio, whose husband was shot dead at home, with her daughter Rogielyn and son Rogie Sebastian. Credit:Kate Geraghty Shortly after a 9am flag-raising ceremony the jail erupts into dance and song to a drummer and lone bugler's stirring rendition of the 1914 popular British Colonel Bogey March. "Filipinos are by and large happy people, even when things look the worst," said Ms Carta, the assistant warden. "We have violence here but the penalties for fighting are up to six months jail so it only happens from time to time," she said.

A 42-year-old prisoner who has been on remand in the jail for 16 years, waiting for completion of his trial on charges of charges of robbery and murder, told Fairfax Media he encourages prisoners to keep busy with activities like sport, dancing and music. "If they do nothing they will go crazy. It's very congested but there are still exercises and things you can do," he said, adding that he paints and has written two books he hopes will be published one day. Prisoners arrested under Mr Duterte's crackdown said they had been treated unfairly and harshly but were at least happy they were not among the bodies that have been piling up across the country, victims of claimed police shoot-outs or attacks by unidentified assailants. A 34-year-old father of two claimed that drug paraphernalia was planted on him by police in June but that he had not used shabu, the highly addictive crystal methamphetamine, since last year. "Police wanted me to become an informer for them and when I refused they set me up," he said.

"He [Duterte] should follow the right processes in making arrests because what is happening now is getting out of hand… some innocent people are getting caught in the dragnet." "I have lost so much, my work, my family…look what they have done to me." Dwight Delmar, 59, who has been awaiting trial on a fraud charge for 19 months, said the prisoners charged with drug offences who had arrived in recent months faced a long wait to learn their fate. Loading "Justice delayed is justice denied," he said.

"The overcrowding conditions we have to endure here are shocking."