A federal judge Friday turned down a request by Mayor Mitch Landrieu’s administration to nullify a controversial $83 million contract that Sheriff Marlin Gusman awarded last year to a third-party company to provide medical and mental health care to inmates at Orleans Parish Prison.

The ruling dealt a significant blow to Landrieu’s efforts to rein in the mounting costs of court-ordered reforms at the jail.

It also underscored, in blunt terms, U.S. District Judge Lance Africk’s insistence that inmates receive better treatment at the troubled lockup, regardless of how much city leaders object to the price tag.

“Moving forward, not backward, is the only path acceptable to the court,” Africk wrote in an 18-page ruling. The jail, he added, “must and will be brought into compliance” with the terms of a consent decree Gusman signed in 2013 with the U.S. Justice Department.

Africk reminded city leaders that poor medical care had been among the conditions “incompatible with the concept of human dignity” that prompted him to mandate sweeping changes at the jail.

One of the consent decree’s many purposes, he wrote, was “to address the stark, sometimes shocking deficiencies in OPP’s medical and mental health care system.”

Africk has described the pace of jail reform as “glacial” as Gusman struggles to recruit — and retain — new deputies to staff the facility.

Landrieu’s administration, which under state law must pay for inmate care, increasingly has resisted shelling out millions of dollars to implement the changes, and it has accused Gusman of making imprudent expenditures without consulting the city.

This standoff was perhaps epitomized by the months-old imbroglio over Gusman’s decision to award a lucrative five-year deal to Correct Care Solutions — a contract City Attorney Sharonda Williams contended was negotiated illegally and without city input. The contract, which according to Africk’s ruling is now being renegotiated, calls for the company to be paid $15.4 million in the first year and $17.3 million by the fifth year.

In asking Africk to declare the deal null and void, city officials pointed to a host of jurisdictions that have comparable jail populations but pay far less for inmate medical care, including Jefferson Parish.

Williams also cited a state statute that affords “the governing authority of each parish” — in this case, the city of New Orleans — the right to appoint a third-party health care provider for inmates.

Gusman attorney Blake Arcuri countered that the city essentially forfeited its right to invoke that law after years of delegating control of inmates’ medical care to the Sheriff’s Office. “The medical department of the Orleans Parish Sheriff’s Office has never been influenced or assisted by the City of New Orleans in any way,” Arcuri argued in court filings, “other than negatively so through its lack of sufficient funding to provide medical care to the men and women which its Police Department arrests.”

While Africk reserved judgment on the wisdom of Gusman’s selection of Correct Care Solutions, the judge seemed sympathetic to Arcuri’s arguments, saying city officials “cannot plausibly claim to be surprised” that the sheriff awarded a contract to a third-party vendor in hopes of improving inmate health care, a key requirement of the consent decree.

“It is utterly inexplicable that, as the sheriff solicited, negotiated, executed and implemented the contract with CCS, the city stood by for a year, only challenging the advisability of the sheriff entering into the CCS contract and not his legal authority to enter into it,” Africk wrote.

The judge pointed to a recently published report, prepared by a team of experts tasked with overseeing progress at the jail, that found the health care contract, even in its infancy, “provides hope for immediate and long-term changes” at OPP.

Africk, as he has in previous rulings, sharply criticized the city for failing to propose a more affordable alternative to the contract Gusman awarded. Landrieu’s administration cited a list of less expensive health care contracts at other jails, the judge wrote, but, “consistent with its past practice of speaking in generalities, it omits whether those jails are also subject to federal court oversight based on decades of unconstitutional conditions or whether those jails lacked an understanding of the basics of medical operations, as was the case at OPP.

“The city is forewarned,” Africk added. “The court will not permit the Orleans Parish Prison to fall short of constitutional standards because of inadequate funding by the city. Until there is some other viable proposal on the table, the CCS contract is the only existing means of providing medical and mental health care, and the city must continue paying for it.”

Gusman did not entirely escape Africk’s criticism. The judge said the sheriff “should have worked with the city in a more meaningful way to obtain input into the CCS contract.

“Such collaboration during the process might have avoided this dispute entirely,” Africk wrote.

Brad Howard, a Landrieu spokesman, said city officials disagreed with Africk’s legal analysis.

Saying the judge “encouraged CCS to renegotiate the contract with the city,” Howard added in an email that the ruling “does not incentivize CCS to renegotiate a more fair and economic contract. As a result of this ruling, the taxpayers of this city may be locked into a bad deal and will continue to overpay for health care services at the jail.”

Follow Jim Mustian on Twitter, @JimMustian.