Two former bookmakers from the 1970s and 1980s told a federal jury Friday that they were forced to make payments to James “Whitey” Bulger and his crew, and that the gangster and his cohorts had a reputation for hurting anyone who did not follow their demands.

“I had heard about them because their reputation preceded them. They were very capable,” said Richard O’Brien, 84, who ran gambling rackets for years and said he was forced into a meeting with Bulger in the mid-1970s.

“You’re working alone ... you ought to be with us,” Bulger told him, O’Brien recalled.

“They were laying down the law,” he told a jury in federal court in Boston.

James Katz, another bookmaker, said he dealt often with Bulger’s right-hand man, Stephen “The Rifleman” Flemmi, and it was his understanding that Flemmi and Bulger ran their gang together.

“You knew Stevie Flemmi had a reputation that he had killed several people?” Bulger’s lawyer, J.W. Carney Jr. asked.

“I would never want to run into him,” Katz acknowledged.

Bulger, 83, is on trial in US District Court, charged in 32 counts of a racketeering indictment that alleges that while running a criminal enterprise from 1972 to 2000, he participated in 19 murders; extorted bookmakers and drug dealers, and businessmen; laundered his criminal profits through real estate transactions; and stockpiled an arsenal of weapons.

Katz told jurors that he paid $500 a month — $1,000 a month during football season — in “rent” to Bulger’s gang, and often drove directly to Bulger’s headquarters in a garage near the old Boston Garden to make the payment.

He also testified that Flemmi and Bulger increased the amount of money that gamblers would have to pay to place a bet, putting more money in their gang’s pockets. And he said that Bulger funded local loansharks.

Katz said people who crossed Flemmi and Bulger were skirting danger. “You can wind up in the hospital, so to say,” he said.

Under Carney’s cross-examination, Katz acknowledged that he had given differing accounts of how many times he had met Bulger. He also acknowledged that his dealings were not with Bulger but with Flemmi and others who claimed to be working for Bulger’s gang, which he called “The Bulger Group.”

Katz, now 72, was placed in a witness protection program as part of his agreement with prosecutors to cooperate and testify against Bulger. He pleaded guilty in 1992 in federal court to gambling, money laundering, and wire fraud, and was sentenced to four years in prison. He also had to forfeit $1 million from a check cashing scheme that he acknowledged laundered millions of dollars.

Katz had a history of gambling convictions in state court and had served months-long prison sentences. “Story of my life,” he said.

But federal prosecutors brought a federal case against him and used the threat of longer prison sentences to pressure him to testify against higher-level criminals.

Katz was initially reluctant to testify, even with the protection of an immunity agreement. He was held in contempt of court, and threatened with an additional 18 months in prison beyond his four-year term.

Then Katz agreed to cooperate, saying he feared prosecutors would seek the forfeiture of his home. He has a wife and three children.

Carney suggested that Katz was shaping his testimony to implicate Bulger so that he could satisfy his agreement with prosecutors to provide “substantial assistance.”

Prosecutors say Bulger was a ruthless killer who terrorized Boston’s underworld for decades. His legend grew when he eluded a worldwide manhunt for 16 years after his indictment in 1995 and when it was learned that he had been protected by the FBI, which considered him a prized informant. The story of his criminal rise, which paralleled the political ascent of his brother, former state Senate President William M. Bulger, has inspired books, TV shows, and movies.

On Thursday, the jury heard from Thomas J. Foley, a retired Massachusetts State Police colonel who testified that FBI agents constantly sabotaged his efforts to target Bulger, forcing investigators to rely on a hitman and other unsavory characters to build a case against the gangster and expose his corrupt relationship with the bureau.

Bulger’s defense team tried to use Foley’s testimony to argue that the FBI was so corrupt in its handling of the notorious South Boston gangster that its claim that he was an informant should not be believed. The defense also grilled Foley about whether the prosecution team let hitman-turned-government witness John Martorano refuse to testify against his friends, as long as he cooperated against Bulger.