Judge Raymond G. Dougan won a major legal victory in ­November, successfully fending off a 61-page complaint from the Suffolk district attorney that his decisions were systematically biased in favor of criminal defendants.

Now, it turns out that a prominent law firm whose lawyers often appear in Boston courts paid for Dougan’s ­defense, giving him at least $85,000 worth of free services – and perhaps much more – from one of the most prestigious ­legal teams in the city.

The pro bono legal services provided by the Boston law firm Foley Hoag could violate the rules of ­judicial conduct that prohibit judges from receiv­ing gifts from law firms whose attorneys have ­appeared before them or are likely to in the future. State ethics law also bars public officials from accept­ing most gifts.

The free legal services, confirmed by Dougan in mandatory reports to the Supreme Judicial Court and the State Ethics Commission, are certainly unusual. Michael Mone Sr., a leading Boston lawyer who frequently represents judges ­before the Commission on Judicial Conduct, said he ­always sends them a bill, ­because he believes he must.

“My interpretation of the law is that in representing individual judges, you cannot make that a gift,” Mone said.

Dougan declined to comment, but his lead attorney, Michael B. Keating of Foley Hoag, argued that no rules were broken. Keating said he was simply standing up for judicial independence.

“As a private lawyer, I decide how much to charge my clients,” Keating said in an e-mailed statement. “Over the years, I have done a great deal of legal work pro bono or at reduced rates. That work has ­included conducting investigations of judges, without compensation, as special counsel to the Judicial Conduct Commission.’’

He said the arrangement with Dougan violated no ethics rules, because neither he nor any of the lawyers who worked on the case have ever appeared before Dougan specifically. However, numerous Foley Hoag lawyers make appearances in district courts, including Boston Municipal Court, where Dougan is the first justice of the downtown division.

Jill Pearson, the former executive director of the Commission on Judicial Conduct, said the rules are clear: Judges cannot get free lawyers to represent them in misconduct investigations.

“The judge pays his lawyer his full, usual fee,” said Pearson, who retired last August while her agency was still conducting its two-year investigation of Dougan. “It would be misconduct for a judge to pay any less, as that would constitute an improper gift from the lawyer to the judge,” she added, stressing that she was speaking generally and not about Dougan specifically.

Suffolk District Attorney Daniel F. Conley triggered the investigation in December 2010 when he took the unusual step of filing a formal complaint about Dougan’s alleged bias. The lengthy report, filed with the Judicial Conduct Commission, detailed dozens of cases in which Dougan sided with defend­ants despite what Conley said was convincing evidence of their guilt.

A Globe report on the controversy found that Dougan’s reputation for favoring the defense had even spawned a nickname from one criminal defendant: “Judge Let Me Go.” The Globe found that Dougan’s rulings were reversed or modified on appeal more often than any other Boston Municipal Court judge.

But judges and defense attorneys rushed to the defense of Dougan, accusing prosecutors of attempting to bully an independent-minded judge.

Keating, who is chairman of Foley Hoag’s litigation department and a former head of the Boston Bar Association, said that he took the case because there was “an important principle at stake.”

“I have often represented individuals, without regard for ability to pay, when I believed that a lawyer could make a difference in vindicating important principles,” he said. “In this case, that principle is ­judicial independence.”

Keating and two colleagues represented Dougan for free throughout the investigation, beginning in 2010 and continuing until at least Nov. 27, 2012, when they responded to a legal filing from Conley’s office. Along the way, they argued and won a landmark ruling from the Supreme Judicial Court preventing investigators from asking Dougan how he arrived at his decisions.

Ultimately, an independent investigator working for the conduct commission, J. William Codinha, produced a confidential report on Dougan’s decisions that was more than 1,000 pages long, including exhibits. But the commission dismissed Conley’s complaint against Dougan, delighting Dougan and prompting Foley Hoag to issue a press release calling the case “one of national interest and significance.”

Keating declined to estimate the value of his law firm’s services to Dougan, saying he had “no intention of describing my fees in this case to the Globe.” Previously, he had refused even to confirm that he was donating his time to Dougan, calling it “a matter between my client and myself” in 2011.

However, Dougan’s own annual reports on outside gifts and income suggest that Foley Hoag had ­donated at least $85,000 in legal services by the end of 2011.

He told the state’s highest court that Foley Hoag donated $15,000 worth of services to him in 2010 alone, and he told the State Ethics Commission that the firm gave him “more than 100 hours” of work in 2011. Legal specialists say that top litigators like Keating typically charge at least $700 an hour, making his time in 2011 worth at least $70,000.

Dougan has not filed financial disclosures for 2012, but some observers say the total value of the ­legal services donated by Foley Hoag could be closer to $250,000 once 2012 is included.

Ironically, the free legal services could trigger a new investigation of Dougan, either by the Judicial Conduct Commission or the Ethics Commission.

Foley Hoag specializes in business and corporate law, but the firm’s website indicates that more than 30 attorneys and paralegals help victims of domestic violence and sexual assault, work that commonly involves district courts. In addition, Foley Hoag sometimes takes criminal cases in Boston.

If the Ethics Commission finds that Dougan has violated the state conflict-of-interest law by accepting the free services, it could fine him up to $10,000 for each violation and require him to pay the legal bill.

Separately, the Judicial Conduct Commission has discretion in deciding what penalties to impose for misconduct, including fines, public censure, and even forced retirement, but the Supreme Judicial Court makes the final decision.

Last week, Howard Neff,
executive director of the Judicial Conduct Commission, would not say whether a judge must pay his own legal bills when dealing with his agency. “That’s not a question I’m in a position to answer,” he said.

A spokeswoman for the Supreme Judicial Court also would not say whether accepting free legal services would violate the judicial code of conduct. However, the spokeswoman, Joan Kenney, pointed to a key paragraph of the code which “prohibits judges from accepting gifts, bequests, favors, or loans from lawyers or their firms if they have come or are likely to come before the judge.”

Keating, Dougan’s attorney, said there is nothing to investigate, arguing that Dougan fulfilled all his ethical duties by reporting the pro bono legal services in annual reports. He noted that no one from the Supreme Judicial Court or the Ethics Commission “has raised a single question” about the gifts.

Any investigation would have to determine the exact value of the gifts from Foley Hoag, a subject on which Dougan is somewhat vague. In his filing with the Supreme Judicial Court, he described the 2011 pro bono legal services as “substantial,” but did not provide a precise dollar value as officials of the court and the Ethics Commission say is required.

Mone, a friend of Keating who has represented several judges in misconduct proceedings, said he always sends judges a bill for his services because they are public employees.

“When I represent a judge, I charge them, but the money goes to charity,” he said. However, Mone added that because the principles at the heart of the Dougan case, judicial independence and judicial privilege, were so important, he understood why “any lawyer would do that pro bono.”