The city’s Department of Correction has a screw loose.

A Rikers guard in charge of supervising the jail’s most dangerous inmates was caught drinking and passing out on the job — but he has hung on to his $70,000-a-year gig for almost three years while the case has played out, The Post has learned.

Yardely Rolando was busted in July 2015 for guzzling vodka at his desk instead of checking on inmates in the segregation unit at the Otis Bantum Correctional Center — a notoriously violent lockup known as “The Bing” — and has been on modified duty ever since in the Transportation Division.

He does “odds and ends” like photocopying, all while still collecting a regular paycheck.

Administrative Law Judge Susan Pagoda finally recommended on Jan. 12 that Rolando be fired — but his bosses still haven’t pulled the plug, his lawyer said Tuesday.

At his hearing in September 2017, Rolando openly admitted that he downed vodka, tequila and cognac for seven hours at a family barbecue before taking some of the hooch to go when he headed for his night shift on July 3, 2015.

After secreting the spirits inside a water bottle, the soused screw mixed it with Pepsi and shared the concoction with another guard, according to the judge’s report, citing a security video.

He dozed off for hours instead of doing his mandatory tours of the facility every 30 minutes — and then lied in the logbook that he had done so, Pagoda wrote.

“[Rolando] conceded that, although he wrote in the logbook that he toured every 30 minutes, he did not actually do so, as confirmed by the video surveillance,” the report says.

“He stated that he knew what he was supposed to do but ‘the alcohol . . . didn’t allow me’ and he was ‘highly intoxicated.’ ”

Rolando, who joined the department in 2011, was eventually caught by a captain who could smell and see that he was wasted, and made the plastered guard take a Breathalyzer test.

He blew .105 and .086 which are categorized as “serious intoxication” and “serious physical instability,” according to the report.

Rolando was suspended for just 30 days before losing his shield and being placed on modified duty.

He tried to sell the judge a sob story, saying he had become an alcoholic after his then-girlfriend had a miscarriage earlier that year, and asked for a mere 40-day suspension as punishment — inclusive of the 30 days he’d been suspended — on the grounds that his addiction is a “disability.”

But Pagoda didn’t buy it — noting that he only sought treatment at the “11th hour” before his hearing, and describing the miscarriage story as “embellished and contrived.”

“After the incident, respondent made only the feeblest of efforts to obtain treatment and, significantly, waited some two years before ever actually enrolling in a counseling program,” she wrote.

“There was no indication that, in those intervening two years, respondent had any other problems related to alcoholism.”

Rolando couldn’t be reached for comment. His lawyer, Peter Troxler, said he couldn’t comment because the DOC hasn’t made a ruling on the judge’s recommendation.

The DOC said in a statement that Rolando is on modified duty and has 30 days to appeal the decision.