BOSTON — A lawyer for James “Whitey” Bulger has identified the federal official he says gave the Boston mobster immunity to commit crimes while he was an FBI informant.

In court papers filed late Wednesday, attorney J.W. Carney said former U.S. Attorney for Massachusetts Jeremiah O’Sullivan granted Bulger immunity.

The revelation was made in a defense motion for Judge Richard Stearns to recuse himself from the case.

Bulger’s lawyers say Stearns has a conflict of interest because he worked in the U.S. attorney’s office in Boston at the same time as O’Sullivan, who died in 2009.

Prosecutors have said Bulger never received immunity.

The 83-year-old Bulger is accused of participating in 19 murders. He fled Boston in 1994 and remained one of the FBI’s most wanted fugitives until his capture in California last year.