James “Whitey” Bulger’s capture could cause a world of trouble inside the FBI.

The ruthless Boston crime boss who spent 16 years on the lam is said to have boasted that he corrupted six FBI agents and more than 20 police officers. If he decides to talk, some of them could rue the day he was caught.

“They are holding their breath, wondering what he could say,” said Robert Fitzpatrick, the former second-in-command of the Boston FBI office.

The 81-year-old gangster was captured Wednesday in Santa Monica, Calif., where he apparently had been living for most of the time he was a fugitive. He appeared Friday afternoon inside a heavily guarded federal courthouse in Boston to answer charges that he committed 19 murders.

Bulger, wearing jeans and a white shirt under a white unbuttoned shirt, was brought into court in handcuffs, which were then removed. He looked tan and fit and walked with a slight hunch.

He had back-to-back hearings for two indictments. Attorney Peter Krupp was appointed to represent Bulger on Friday, but Bulger asked that a public defender be appointed.

The government objected, citing the $800,000 found in his apartment and “family resources,” including money from relatives.

“We feel he has access to cash,” said prosecutor Brian Kelly.

In the second hearing, Magistrate Judge Marianne Bowler asked Bulger if he could pay for legal counsel.

“I could, if you give me my money,” Bulger replied.

The government is seeking to seize Bulger’s assets, which prosecutors said included the cash and 30 guns found in the apartment.

Prosecutors also asked that Bulger be held without bond. Bulger waived his right to a detention hearing Friday.

Bulger’s girlfriend, Catherine Elizabeth Greig, who was arrested with him, was scheduled to appear in court on charges of harboring a fugitive.

Bulger, the former boss of the Winter Hill Gang, Boston’s Irish mob, embroiled the FBI in scandal once before, after he disappeared in 1995. It turned out that Bulger had been an FBI informant for decades, feeding the bureau information on the rival New England Mafia, and that he fled after a retired Boston FBI agent tipped him off that he was about to be indicted.

The retired agent, John Connolly Jr., was sent to prison for protecting Bulger. The FBI depicted Connolly as a rogue agent, but Bulger associates described more widespread corruption in testimony at Connolly’s trial and in lawsuits filed by the families of people allegedly killed by Bulger and his gang.

After a series of hearings in the late 1990s, U.S. District Judge Mark Wolf found that more than a dozen FBI agents had broken the law or violated FBI regulations.

Edward J. MacKenzie Jr., a former drug dealer and enforcer for Bulger, predicted that Bulger will disclose new details about FBI corruption and how agents protected him.

“Whitey was no fool. He knew he would get caught. I think he’ll have more fun pulling all those skeletons out of the closet,” MacKenzie said. “I think he’ll start talking and he’ll start taking people down.”

A spokesman for the Boston FBI did not return calls seeking comment. In the past, the agency has said that a new generation of agents has replaced most or all of the agents who worked in the Boston office while Bulger was an informant.

— Associated Press