F. Lee Bailey, the superstar lawyer who was part of O.J. Simpson’s defense team, has filed for bankruptcy in federal court in Maine in an attempt to discharge a federal tax debt of nearly $5.2 million.

Debts to the Internal Revenue Service are not normally discharged in bankruptcy proceedings, but Bailey said Friday that they can be after a period of time and as long as he has complied with certain conditions, such as filing and paying his taxes on time since the original taxes and penalties were assessed. He owes the money from a dispute over his reportable income from 1993 to 2001.

“After trying very hard to settle the case, the IRS turned me down on the grounds that I am a celebrity and it would look bad for them to settle the case,” Bailey, who now lives in Yarmouth, said Friday. “There’s a good case to be made for bias, but I’m not the one to make that case.”

Bailey was disbarred in Florida in 2001 over his handling of shares of stock owned by a client who pleaded guilty to drug smuggling and money laundering. That stock also led to the dispute with the IRS, which said Bailey owed $1.9 million because of his failure to report some of the stock proceeds as income. With interest and penalties, the IRS filed liens against Bailey totaling $4.5 million, which has since grown to nearly $5.2 million.

The bankruptcy filing also lists $364,925 owed on Bailey’s Yarmouth condominium, but it also said Bailey will seek a “reaffirmation agreement,” meaning he won’t try to have that debt discharged. He also owes $40,000 on an unsecured loan from Alvin Malnik, a lawyer who owns a restaurant in Florida.

Bailey said he wants to discharge what he owes to the IRS because “at 83, it’s a little late to raise that kind of money overnight. It’s been a long battle.”

In 2000, the Florida Bar found that Bailey misappropriated client assets, communicated with a judge improperly, had a conflict of interest, was guilty of self-dealing and testified falsely under oath and ordered him disbarred, a ruling that was upheld by the Florida Supreme Court. The Massachusetts Bar issued a reciprocal disbarment two years later, but Bailey applied for admission to practice law in Maine in 2012, three years after he moved to the state. The Maine Board of Bar Examiners voted 5-4 to deny him admission to the bar, saying he lacked “the requisite good character and fitness” to practice law in the state.

Justice Donald G. Alexander of the Maine Supreme Judicial Court overturned that finding in April 2013 and ordered the bar to issue a certificate of qualification to practice law, saying Bailey seemed to be making a “genuine effort” to resolve the tax debt, which Alexander had said was the main stumbling block to allowing Bailey to practice law in the state. The bar board appealed to the full state supreme court, which voted 4-2 and issued a 59-page ruling in 2014 to deny Bailey’s admission to practice law regardless of resolving the debt, saying he “failed to prove by clear and convincing evidence that he recognizes the wrongfulness and seriousness of the misconduct that resulted in his disbarment.”

Bailey first rose to national prominence in the 1960s, successfully defending Dr. Sam Sheppard of Ohio, who was charged with murdering his pregnant wife.

Bailey appealed Sheppard’s initial conviction, and the U.S. Supreme Court said a “carnival atmosphere” around the first trial denied Sheppard a fair hearing. Sheppard was acquitted in a retrial.

The case inspired “The Fugitive” television series and later movie.

Bailey also represented Albert DeSalvo, accused of being the “Boston Strangler,” and was part of Simpson’s legal team, on which he led the effort to paint one of the police detectives, Mark Fuhrman, as a racist.