A longtime criminal and his girlfriend are on their way out of the South Boston projects after the cops busted them for dealing fentanyl, authorities say.

Jose Pagan, 44, and Ana Martinez, 45, both of Old Colony Avenue, remain behind bars after being arraigned yesterday in South Boston District Court on charges of selling drugs.

Boston police suspecting crack dealing busted into the pair’s apartment yesterday afternoon about 4:45 with a search warrant and found 153 grams of fentanyl and 50 grams of crack cocaine, according to court documents. The cops also seized pot, pills and hundreds of dollars in cash from the apartment.

Martinez is the lessee of the apartment from the Boston Housing Authority, and she told police she has been letting Pagan, her boyfriend, stay with her for the past year.

When police first spoke with Pagan, he told them he lived at the Southie apartment. But once he figured out they were raiding the unit for drugs, he changed his story to say he lives in Chelsea.

The cops say Pagan admitted to having some crack in his apartment, but maintained the other drugs weren’t actually real — that they just “looked like illegal drugs because he was concerned about being robbed,” the cops wrote.

Both Pagan and Martinez are due back in court Dec. 19; Martinez is held on $50,000 bail and Pagan on $500,000. Judge Michael Bolden cited Pagan’s “10-page” rap sheet as he set the high bail.

Suffolk District Attorney spokesman Jake Wark said the DA sought the high bail because of Pagan’s two convictions in the past five years for slinging drugs in addition to a mix of other crimes including theft.

“We began eviction proceedings today,” Housing Authority chief William McGonagle told the Herald. “We’ll toss ’em out as quickly as the law allows.”

McGonagle noted that he himself grew up in these same Mary Ellen McCormack projects, so he knows them well — and how “egregious” it is for people to be selling opioids there.

“We’ve got people dying in this neighborhood from fentanyl,” McGonagle said.