It looked like Carl Lemon would be going back to jail for the 20th time. Saddled with a 25-year record of shoplifting, drug dealing, and assorted other crimes, not to mention eight aliases, Lemon had made it easy for prosecutors. He even signed a confession saying that he had stolen a woman’s purse while she ate in a Back Bay restaurant. A second victim, whose bag he also snatched, had driven overnight from Canada to testify against him.

But, as the two victims watched in disbelief, the judge set Lemon free, saying that the career criminal, then 43, needed a detox program, not jail time. When the detective who arrested Lemon rolled his eyes and muttered that the decision was a disgrace, Judge Raymond G. Dougan Jr. had court officers lock him up for the morning instead.

“I thought someone was going to jail that day; I just didn’t think it would be me,’’ recalled Detective Andrew Gambon.

Dougan may be the most lenient judge in Boston, a prosecutor’s nightmare whose decisions are appealed by district attorneys far more often than any other judge in the Boston Municipal Court system, court records show. Appeals courts overturn his decisions the most, too, more than once including stern warnings that he should follow the law instead of his personal feelings. The 20-year-veteran judge’s reputation is so well established that one defendant predicted to police that he would go free after he went before “Judge Let Me Go’’ Dougan, according to the police report.

Get Fast Forward in your inbox:

Forget yesterday's news. Get what you need today in this early-morning email.

A Globe review of scores of cases decided by Dougan reveals a pattern of rejecting police testimony while extending second chances to criminals whose rap sheets go on for pages.

His approach sometimes backfires. Lemon, for instance, did not show up for the alcohol treatment Dougan ordered. Likewise, Dougan released a career criminal named Eric French after he was convicted of breaking into Locke-Ober restaurant in 2009, ruling that the 18 days he served awaiting trial was punishment enough. Ten weeks later, French was arrested for breaking into Locke-Ober again. This time, another judge sentenced him to 18 months in jail.

After years of frustration, Suffolk District Attorney Daniel F. Conley is mounting an extraordinary campaign to remove Dougan from criminal trials altogether. Each day when the bushy-haired, bearded Dougan takes the bench in the Edward W. Brooke Courthouse, an assistant district attorney asks him to withdraw from the case on the grounds that he cannot be fair, and each time Dougan refuses. Meanwhile, Conley is asking the Supreme Judicial Court to bar Dougan from hearing cases involving the Suffolk district attorney.

Conley has also taken the rare step of filing a complaint against Dougan with the Judicial Conduct Commission, the same panel whose lengthy investigation prompted Judge Maria Lopez to resign in 2003. At the request of the commission, which does much of its work in secret, the SJC has already appointed a special counsel, longtime government corruption investigator J. William Codinha, to investigate the bias complaints against Dougan.

”It is my fundamental obligation to protect the citizens of Boston and all of Suffolk County,” said Conley, referring to the daily motions for Dougan to recuse himself. He would not comment on his complaints to the SJC or Judicial Conduct Commission, or even acknowledge their existence. “I cannot stand by while a clearly biased judge ignores the law and threatens public safety.”

But in a state where judges are appointed for life until age 70, Dougan enjoys the support of the person with the most say over his professional life, his boss. Chief Justice Charles R. Johnson defends Dougan, calling him “one of the hardest-working and most conscientious judges in the judiciary.’’ Johnson has resisted behind-the-scenes efforts to transfer Dougan to civil court.

Dougan’s defenders, including numerous defense attorneys, say that Conley’s tactics are both unwarranted and a threat to the independence of judges.

“Some judges will do what the district attorney wants 95 percent of the time,’’ said Peter Krupp, board member of the Massachusetts Trial Lawyers Association, which has filed a brief supporting Dougan with the SJC. “Is the judge doing what the law requires, independently exercising his discretion, or is the judge abdicating his or her discretion in deference to the DA?’’

Dougan declined to comment on the controversy, saying it violates the judicial code of ethics to publicly discuss his judgments in individual cases.

“He is a man of respect and experience who has decided thousands of cases over his career,’’ said Keating. “It is not frankly clear to me why the district attorney is doing this.’’

But Conley is not the only senior public official speaking out against Dougan. Boston Police Commissioner Edward F. Davis said he is worried that Dougan is releasing dangerous criminals to prey on new victims. Detective Gambon and other officers are “clearly upset by their treatment’’ by Dougan, Davis said, “but this isn’t about the police. This is about justice and what’s right for the community.’’

Dougan, first justice of the Boston court’s central division, comes across as serious but solicitous in his courtroom, referring to defendants in handcuffs as gentlemen and closely questioning lawyers about documents in the case file. Before he was appointed to the bench in 1991 by Governor Michael S. Dukakis, Dougan had risen through the ranks of the attorney general’s office to become chief of the Environmental Protection Division, making him a largely unknown quantity to county prosecutors.

But a review of Dougan’s record on the bench shows a history of battles with law enforcement officials, from setting the appropriate bail for defendants to whether to send them to jail after conviction. Again and again, prosecutors complain that Dougan follows a pro-defendant personal philosophy instead of the laws he is supposed to enforce. For example:

■ Martin Joseph Foley, a patient at Massachusetts General Hospital after a suicide attempt, allegedly threatened a woman with scissors in a hospital bathroom on Jan. 25, 1999. Foley did not show up for his arraignment, but Dougan let him remain free without bail, over prosecutors’ objections, as long as he showed up for his next court date. On May 10, 2000, four days before he was due in court, Foley allegedly kidnapped a woman and drove her to a remote forest in Plymouth where he allegedly raped and robbed her. He is still receiving psychiatric care while committed at Bridgewater State Hospital.

■ Dougan dismissed drunken driving charges against Daniel Quispe, even though Boston police said his blood-alcohol level was twice the legal limit when he was stopped in 2000. Dougan said that he was serving “public justice’’ by dropping the charges against Quispe, a native of Peru, because he faced possible deportation if convicted. That, Dougan argued, was too severe a penalty.

“After considering the serious potential consequences to Quispe of an admission to the charges . . . the court concluded that dismissing the complaint was in the interest of public justice,’’ Dougan wrote.

The Supreme Judicial Court eventually struck down Dougan’s decision, writing that Dougan’s “personal views regarding the wisdom or propriety’’ of immigration laws “are irrelevant and undermine the principle of separation of powers.’’

■ Alander Gooden, whose record stretches back to 1998, was arrested for carrying a gun on June 2, 2007, after police said he appeared nervous and shaking and crawled out of his car as they approached him on a Dorchester street. When they searched his unregistered vehicle, they found the weapon. But Dougan said he did not believe the police account and said they did not have cause to search Gooden’s car in the first place, so he threw out the evidence.

An appeals court eventually overturned Dougan’s decision and reinstated the gun charges on June 24, 2009, but by then Gooden had already been arrested for more crimes. Gooden was sent to prison for three years for trafficking cocaine. On the original gun case, another judge, Tracy-Lee Lyons, convicted him, sentencing him to 18 months in the Suffolk House of Correction.

■ Michael Gordan was arrested last December on charges of possessing automatic weapons and drug paraphernalia in his Dorchester apartment. When he came before Dougan, the judge immediately reduced Gordan’s bail from $100,000 to $3,000, but just as Gordan was about to go free, the Suffolk County sheriff learned that he was wanted in Kentucky on charges of failing to pay child support. A Kentucky sheriff asked that authorities here hold Gordan so that they could come and get him. Dougan let him go anyway. He is still wanted in Kentucky.

“We wouldn’t issue warrants if we didn’t want the people back,’’ said Robert Noble, chief deputy of the Oldham County sheriff’s office. Only once before in his experience, he said, had a wanted fugitive been set free by another law enforcement agency, and that time it was a mistake.

Dougan’s attorney Keating said his client has a defense for each of those decisions, but he is prevented from discussing them by the judicial code of ethics.

Over all, prosecutors have challenged Dougan’s judgments far more than any other current Boston Municipal Court judge, a Globe review of appeals posted on the Supreme Judicial Court website found. Since the mid-1990s, Conley and his predecessor, Ralph C. Martin II, have formally appealed 50 of Dougan’s decisions, while the second most-challenged judge, 18-year BMC veteran Mark Summerville, faced only 14 appeals by prosecutors. All by himself, Dougan accounts for more than one-third of the appeals filed by prosecutors against all current Boston Municipal Court judges.

Just as telling, appeals courts have reversed or modified Dougan’s decisions 28 times since the mid-1990s, 11 more than the next most frequently reversed judge, Summerville. All but four of Dougan’s reversals came in response to complaints from the district attorney.

Other judges say that reversals are personally painful, akin to a public dressing-down.

“No one likes to be reversed,’’ said a district court judge outside Boston, who according to court records has been reversed twice. “I have a low tolerance for it. I pride myself on knowing the law and applying it properly. I don’t cut corners to make people love me.’’

Although lawyers routinely grumble in private about judges’ perceived prejudices, it is extremely rare for a prosecutor to file a formal complaint against a sitting judge. Even former Bristol District Attorney Paul F. Walsh Jr., who battled publicly against Superior Court Judge Ernest Murphy after he released four alleged rapists without bail in 2002, never went so far as to contact the Judicial Conduct Commission.

“It’s kind of a measure of last resort,’’ said Walsh. “I fought with judges all the time. It’s like [Boston Celtic] Kevin Garnett arguing with the ref. That was part of the game. A [Judicial Conduct Commission] filing — that’s not just arguing the calls; that’s saying you’re doing something institutionally wrong and someone needs to stop you.’’

But the showdown between Conley and Dougan has been building for years. Conley, who was appointed district attorney in 2002, said, “I’ve known since shortly after arriving here that Judge Dougan presented a problem for us.’’

He said Dougan makes little effort to conceal his sympathies for defendants, sometimes instructing new defense lawyers to “ask around about my reputation’’ before deciding whether they want him or a jury to decide their clients’ fate. One defense attorney, who asked to remain anonymous because he appears in front of Dougan, said that “it would be legal malpractice’’ for a defense attorney to choose a jury’s verdict over the sympathetic ear of Judge Dougan.

Keating said he does not believe that Dougan has a reputation for leniency.

In 2009, Conley handed a dossier of cases to Johnson that he believed demonstrated Dougan’s bias against prosecutors and police. The next day Johnson told Conley that Dougan had a new assignment, to review the way the court handles civil lawsuits. “He was on the civil side for 18 to 20 months, and that was good for public safety in Boston,’’ said Conley.

Conley said he took the confrontational step of complaining to the SJC only after Dougan resumed hearing criminal cases last December.

“It’s not something that I hoped would become a public dispute,’’ said Conley.

But Johnson said that he never agreed with Conley’s criticisms and that the timing of Dougan’s temporary assignment was coincidental. In fact, Johnson promoted Dougan to first justice of Boston Municipal Court while he was assigned to civil cases.

Johnson said it was a matter of principle that he not allow the district attorney’s complaints to unduly influence his judgment: “I cannot have litigants determine which judge should be hearing their cases in any point in time . . . That would involve a complete breakdown of the court system’s impartiality.’’

Gillian Pearson, executive director of the Judicial Conduct Commission, would not comment on Conley’s complaint or acknowledge an investigation is underway. The commission’s work will remain secret unless it recommends formal charges to the Supreme Judicial Court or it reaches a point in the review that includes a public statement.

However, the fact that the Supreme Judicial Court has appointed a special counsel to investigate Conley’s complaint suggests that the commission is taking it seriously. Codinha specializes in government investigations and white collar cases, serving as special assistant attorney general to the Ward Commission, in 1980-81, which investigated corruption in the awarding of state building contracts.

The Conduct Commission process can take as long as two years, as in the case of Lopez, who resigned in 2003. She came under fire for ordering probation for a transgender man accused of sexually assaulting an 11-year-old boy and then berating the prosecutor when he objected.

John Russell, a defense lawyer who appears frequently before Dougan, said he is confident that anyone who looks closely at Dougan will find him compassionate and fair.

“He’s attuned to the plight of the people who come before him,’’ said Russell. “He’s not necessarily a prosecutor’s judge. But I don’t think he’s anybody’s judge.’’

But Conley said that in 27 years as an attorney he has never before publicly accused a judge of bias, and he called the idea that he is threatening the independence of the courts “utter nonsense.’’

“I’ve read John Adams, who really was the founding father who envisioned an independent judiciary,’’ said Conley. “But when Adams envisioned an independent judiciary, he didn’t envision Raymond Dougan.’’

BostonGlobe.com complimentary digital access has been provided to you, without a subscription, for free starting today and ending in 14 days. After the free trial period, your free BostonGlobe.com digital access will stop immediately unless you sign up for BostonGlobe.com digital subscription. Current print and digital subscribers are not eligible for the free trial.

Thanks & Welcome to Globe.com

You now have unlimited access for the next two weeks.

BostonGlobe.com complimentary digital access has been provided to you, without a subscription, for free starting today and ending in 14 days. After the free trial period, your free BostonGlobe.com digital access will stop immediately unless you sign up for BostonGlobe.com digital subscription. Current print and digital subscribers are not eligible for the free trial.