In an era of budget shortfalls and market-based solutions, the American penal system is quickly becoming a for-profit enterprise.

Private prisons, once an isolated and temporary solution meant to house low-level inmates, incarcerate eighteen times more people than they did just a couple decades ago. In certain states, private probation companies perform all of the work of an exhausted legal system — from levying fines to collecting payments for misdemeanors — without any need for a judicial authority.

But while the privatization of criminal justice may appear to be a recent development, it is more a reversion than an innovation, a return to the common — and blatantly corrupt — standards of the American and British legal systems of the eighteenth and nineteenth centuries.

During that time, both American and British jails were run as private businesses and typically functioned as debtor’s prisons. With little oversight, they operated as organized extortion rackets. Prisoners were charged for every minor accommodation, from clothing and food to the shackles on their feet. Any host of superficial reasons could be concocted by the jailers to add on more fees, which only served to keep prisoners perpetually in debt and extend their stay.

Entering the prison cost a fee — a “garnish” — and those who couldn’t pay had to surrender their clothes. Even leaving the prison at the end of their sentence had a price. Prisoners who couldn’t afford the exit fare had to work crushing grain into flour on large tread wheels to pay their way.

Otherwise, jobs within the prison were scarce. Desperate for money to pay for food and clothing, women and children regularly prostituted themselves to the wardens and other prisoners. Many spent their lives paying off their debts, sometimes raising families behind the prison walls. An idle debtor, whose only original crime was being poor, could be consigned to a life of indentured servitude.

The incentive for jailers to maximize revenue and cut costs on accommodations meant that most prisoners lived in utter depravity. Rooms were cramped and filthy, with no sense of order. For those with money, private quarters with decent food, drink, and bedding were available, but everybody else lived in abject squalor. In London’s Newgate prison, also known as the city’s “prototype of Hell,” there were almost a hundred prisoners for every guard and a prisoner for every few square feet.

Without bedding, clothes, or anything in the way of medical treatment, the prisons were plagued with disease. Typhus, otherwise known as “gaol fever,” was rampant, and many died just from being temporarily detained. The stench of such condensed humanity filled the air.

As Captain Alexander Smith wrote in 1719, “Newgate is a dismal prison . . . a place of calamity . . . a habitation of misery, a confused chaos . . . a bottomless pit of violence, a Tower of Babel where all are speakers and no hearers.”

Running a private debtor’s prison was an immensely lucrative business for the jailers. Not only were they paid by the state for handling prisoners, they racked up thousands of pounds in fees and effectively received free labor. Jailers used their outsized wealth and influence to bribe police officers and judges so they’d find more people guilty of more crimes and have them sent to their particular jail.

In both London and America, many judges’ remuneration was fee-based, making them particularly prone to corruption. Without a salary as a regular source of income, the justices regularly exchanged favors for decisions — a practice known as “trading justices.” Judges that indulged in selling their decisions were viewed as beneath contempt; their base venality made them “indistinguishable from the criminals with whom they dealt.”

For magistrates in London’s notoriously corrupt Middlesex County, anything could be bought, from a stay of execution for defendants to an automatic guilty verdict for plaintiffs. A not-guilty verdict could be purchased for half a dozen chickens. Magistrates could be paid off by businesses to avoid prosecution, or they could be bribed by the jailers to give a guilty decree without evidence. Justices colluded with plaintiffs on false charges and then split the winnings from the trial.

Because of their payment on a per-hearing basis, some magistrates went so far as to encourage more vice within the community they served. The accused didn’t need to be found guilty — as long as there was a trial, the justices got paid. Justices manipulated the costs and quantity of court and procedural fees to make sure they received a hefty income.

They could make witnesses appear out of the ether to unnecessarily lengthen trials.Whether these supposed witnesses had anything to do with the case was beside the point. Such costs additionally burdened the poor, who might avoid a vigorous defense or plead no contest just to avoid legal expenses.

Police of the era were also hopelessly corrupt and were commonly accused of fomenting crimes to give them — and the justice and gaolers with which they conspired — more business. In America, constables trolled the night looking for the “generally friendless, comfortless, houseless, destitute of a morsel to appease the most urgent calls of nature” or those of “unbridled festivity.”

Once captured, they were taken before magistrates who piled on the fees. Those unable to pay were sent to workhouses to pay off their indenture. The constables and trading justices that collaborated in such a way were often considered the basest of scoundrels, whose abuse of power made them “lost to every principle of humanity.”

In London, the proliferation of crime encouraged magistrates to offer rewards to ordinary citizens as unofficial policemen. Dubbed “thief-takers,” they were paid to inform on and apprehend criminals. But such a piecemeal financial motivation also encouraged the thief-takers to create crime for their own benefit. They often became “thief-makers” who convinced the gullible to commit nefarious acts, and either collected the reward for turning them in or extorted a higher amount out of the guilty party to remain quiet.

Organized criminals like Charles Hitchen and Jonathan Wild exploited the reward system with little compunction. They would use low-level thieves to commit crimes, take a percentage of their earnings, and then turn in the perpetrators to the police for the reward money. Wild was said to maintain a ledger detailing every thief and crook throughout London. Those within his organization received a cross next to their name. Those to be purged and handed over to the police received a double cross (this is where the term “double-cross” originated).

By playing each side against the other, manipulating both the police and petty criminals and coordinating with jailers, they controlled the London underworld through a complex array of extortion, blackmail, and bribery. They became pillars of the community and were seen as “master policemen” for their vigilance against the crimes that they were actively facilitating. Wild even had the audacity to appear at the public hangings of lowly fall guys within his own criminal empire that he had excommunicated.

A public handbill distributed around London titled “The Rat-Trap, or Villainy in Full Bloom” levied a litany of offenses at the corruption between the justices, the solicitors, the jailers, and the police: “there is a good understanding kept up between the amiable trio, justice, solicitor, and thief-catcher, it is almost impossible to determine in many cases which ought to receive the reputation of hanging the innocent or screening the guilty.”

The perverse incentives of a privatized justice system have been repeated numerous times since, in different eras and in different locations. In particular, the Reconstruction-era South was well known for the convict-leasing system, where prisoners could be lent out to work on private work projects.

By legalizing prison labor in for-profit industries, convict leasing created a pernicious relationship between the jails, the police, and the private industries that benefitted from free prison labor. The local police could be surreptitiously paid to arrest the innocent for minor infractions like vagrancy and then ship them off to work in cotton fields without pay.

Eventually, such opportunities for corruption were abolished. Convict leasing in the United States disappeared as news reports highlighted stories of the system’s barbarity. In some states, abandoning fee-based prisons reduced the prison population by half.

In London, the Middlesex Justices Act of 1792 ensured that all judges would be paid for their work independent of how many trials they oversaw or what verdicts they handed out. Rewards for thief-takers were eventually eliminated by Parliament through what was eventually referred to as Jonathan Wild’s Act. For-profit prisons were dismantled in Britain in 1814 under the assumption that a fee-based prison system only encouraged abuse.

And that gets at the core of the problem with privatized criminal justice, both during the Victorian era and today: it makes “justice,” even more so than usual, a pawn of profit.