A Brooklyn NYPD boss doled out comp time to his cops so they would turn a dingy station house garage into a private cigar lounge — where officers puff away in violation of city and state law, The Post has learned.

Capt. Anthony Longobardi — a key figure in the 2014 “stop and fix” scandal involving Eric Garner’s mom — and his smoking buddies routinely stink up the 62nd Precinct headquarters with their stogies, sources said.

“A lot of cops are unhappy about it and complain about it in-house,” one source said.

Shortly after being named commanding officer in September, Longobardi offered the comp time to cops so they would clean out and paint the garage walls after their shifts, another source said.

Photos obtained by The Post show two cigar boxes — including one labeled “Cuba Selectos” — along with a humidor, a cigar cutter and two lighters atop an oak coffee table surrounded by an off-white, sectional sofa and several folding chairs in a corner near the precinct’s bicycle fleet.

Other photos of the 62nd Precinct garage show a standing, silver-colored ashtray holding cigar butts and wrappers, and either a pair of tank-top propane heaters or electric space heaters pointed toward the seating area.

Longobardi restricts access to the lounge — and only lets a select group of cops light up there, with one source saying: “It’s for certain people, the CO’s favorite people.”

They include Lt. Mohamed Eltony, another source said, adding that Eltony has served as Longobardi’s integrity control officer — a role that’s supposed to help prevent corruption.

The manager of a nearby tobacco store, the Cigar Emporium at 1953 86th Ave., said a group of cops regularly visits his store to stock up on Java brand cigars, including in mint and latte flavors.

“They’re regular customers. I know they’re cops because they wear uniforms,” said Charles Kim, 26.

“They say they smoke in a lounge in the city.”

New York City banned smoking in all government-owned buildings in 1995, according to NYC Smoke-Free, a program of the city-funded Public Health Solutions non-profit group.

Under an expanded anti-smoking law signed by then-Mayor Michael Bloomberg in 2002 — and a similar state law signed by then-Gov. George Pataki — violations are punishable by fines of up to $2,000 each.

Prior to assuming command of the 62nd, Longobardi was executive officer of the 67th Precinct in East Flatbush.

Earlier, he was assigned to the 120th Precinct on Staten Island, where as a lieutenant in 2014 he and a sergeant purchased and installed a headlight bulb on a minivan owned by Gwen Carr, the mother of NYPD chokehold victim Eric Garner.

Carr —who had been ticketed for driving with a busted headlight — was also given paperwork showing it was fixed within 24 hours so she could avoid paying a $150 fine.

Longobardi declined to comment, but the president of his union — who admitted there was smoking in the garage — said, “There have been no complaints about smoking in violation of local ordinance.”

“Do they smoke cigars there? Yes,” said Roy Richter of the NYPD Captains Endowment Association.

“It’s a garage with a rolldown gate. There’s adequate ventilation. It’s not considered a confined space.”

Richter also defended Longobardi for having the garage “cleaned up and painted to improve precinct morale.”

Despite Richter’s admission that the cops smoke in the garage, an NYPD spokesman claimed that was not the case.

“The 62 Precinct station house has a lounge for police officers, just like any other command in the city,” said Assistant Commissioner J. Peter Donald, in a written statement.

“It is not the commanding officer’s cigar lounge, as you allege. Every police officer assigned to the command have access to the lounge, which was recently painted and cleaned.”