MIAMI — In an unprecedented case, federal prosecutors have charged a Miami man with engaging in a massive money-laundering operation that moved millions stolen from the federal Medicare program into Cuban banks.

Prosecutors say Oscar Sanchez, 46, was a key leader in a group that funneled $31 million in Medicare dollars into banks in Havana — the first such case that directly traces money fleeced from the beleaguered program into the Cuban banking system.

Most of the money moved through an intricate web of foreign shell companies before ending up in Cuba, to avoid being detected in the United States, investigators said.

“We’re obviously dealing with a very sophisticated network,” Ron Davidson, an assistant U.S. attorney, said during a court hearing Monday.

The federal investigation marks the first time prosecutors have brought a cash-for-Cuba case in the ongoing battle against Medicare fraud in South Florida, which leads the nation in dollars fleeced from taxpayers.

Despite arguments from Sanchez’s attorney Monday that his client was not a flight risk and has family ties to Miami, U.S. Magistrate Jonathan Goodman ordered the defendant be held without bail.

“The fact that (he) has made more than 78 trips out of the country over the years” was a major reason, the judge said.

For years, Sanchez was a player in a global money-laundering organization that spanned from Montreal to Havana, prosecutors said.

Although no one else has been charged so far, prosecutors say Sanchez, who owned a cash-checking business, was in a position to launder millions in government checks and wire payments doled out to crooked providers between 2005 and 2009.

He was charged last week with one count of conspiracy to commit money laundering.

“Oscar Sanchez was a financier for fraudsters and a capitalist for the Cuban banks,” prosecutors said in a court motion.

While Sanchez was a target of the ongoing investigation, prosecutors say dozens of crooked Medicare providers — who offered HIV and medical equipment services — all took part in the laundering scheme set up for one reason: to hide the money.

With millions pouring in from Medicare, suspects opened 15 bank accounts in Canada and Trinidad to move the money from the United States, court records show.

In one major tactic, the ringleaders plunked down millions to buy reams of money orders — 20 boxes in all — and then put the money into an account in the Royal Bank of Canada in Montreal. To make the purchases, they used a host of names, including a famous alias: Bill Clinton.

Then, after the money was concealed in the bank accounts, it was immediately wired to several accounts at Republic Bank in Trinidad.

Investigators later found out that the accounts were not actually opened in Trinidad, but at the branch of Republic bank in Havana, records show.

In addition, the bank had firm instructions on two of those accounts to wire all the money immediately into the Cuban banking system.

So far, prosecutors, who are gathering their information from financial records and unnamed witnesses, said they have traced $63 million into Cuban banks — nearly half tied to Sanchez’s case. “This is not a traditional money-laundering case,” prosecutors said.

One reason that the rogue health care providers turned to Sanchez was because he acted like a money machine, providing much-needed cash to them while they were waiting for their money to be laundered, prosecutors charged.

“The defendants’ money-laundering operation was faster, more efficient, and financially benefitted everyone involved, including (Oscar Sanchez), who charged a fee for his services,” prosecutors wrote.

In all, 70 medical company owners in South Florida submitted more than $374 million in claims to Medicare, and were reimbursed about $70 million.

Many of those providers wanted to withdraw their proceeds in cash to “purchase luxury items or to pay illegal kickbacks,” Davidson wrote.

Though prosecutors charged that Sanchez would be a flight risk if released on bail, defense attorney Peter Raben said most of the trips were to Mexico, where his client owned a condo.

He said charging Sanchez in the international money-laundering ring was “a big red herring” to taint his client, who has no prior convictions.

Prosecutors say Sanchez was part of a much larger scheme to get money into Cuba, a Communist country that does not extradite fugitives from the United States.

As part of the Sanchez case, prosecutors are asking the court to seize seven homes he owns in Miami-Dade, Lee and Collier counties as well as two vehicles to recover the millions in laundered money.

Experts who have watched Miami-Dade emerge as the nation’s Medicare fraud capital say the Cuban government’s involvement would not be too far-fetched — although they have no proof to back it up.

Andy Gomez, a senior fellow of Cuban studies at the University of Miami, said he has heard from sources in Miami and Cuba that the Castro government extorts Medicare bounty from criminals who are allowed to travel freely between here and the island nation.

More than two dozen people charged with Medicare fraud have fled back to Cuba over the last five years, and many more are suspected of hiding there.

“The Cuban government knows what’s going on,” Gomez told McClatchy Newspapers last year.