Inmates sleep inside Quezon City Jail in Manila, Philippines, October 19, 2016. REUTERS/Damir Sagolj

Since Rodrigo Duterte took office as Philippine president at the end of June, the war on the drug trade he promised to initiate has claimed thousands of lives — some 2,300 according to official statistics, more than 4,000 by other accounts.

But the crackdown on drugs and drug use in the Philippines has ensnared hundreds of thousands of other people.

By September, more than a half-million people had turned themselves in to authorities for drug-related matters, and today many of country's jails remains packed with Filipinos rounded up as part of the anti-drug campaign.

And some of those people languishing in jail consider themselves lucky.

"It's safer here," Jason Madarang, who waits face trial on a charge of drug use in Quezon City Jail, east of Manila, told Reuters. "Outside, if the police want to shoot you, they shoot you, and then say you're a drug pusher."

Quezon City Jail was built for 800 inmates, but its population was more than 4,000 at a point in mid-August, packed with suspects picked up in the anti-narcotics effort. The jail insisted that some prisoners be relocated.

"If we hadn't done that, we'd have 5,000 inmates by now," Lucila Abarca, the prison's community-relations officer, told Reuters. The jail now holds more than 3,400 people, two-thirds of whom are there for drug-related offenses.

That Duterte's government's "aggressive campaign against criminality and drugs" has expanded the prison population was to be expected, Jesus Hinlo, the undersecretary for public safety at the Philippines' Department of the Interior and Local Government, told Reuters.

"The solution is ... to build new and bigger jails," Hinlo added, saying that a lack of funds made doing that harder.

Below, you can see a selection of Reuters photos documenting the squalor in which some victims of the Philippines' drug war find themselves.