By Nate Raymond

BOSTON (Reuters) - A Brazilian whose arrest led U.S. authorities to discover $17 million hidden under a mattress pleaded guilty on Thursday to charges that he tried to launder funds tied to one of the largest pyramid schemes ever.

Cleber Rene Rizerio Rocha, who prosecutors said tried to help get money out of the United States that a co-founder of TelexFree Inc left behind when he fled the country, entered his plea in federal court in Boston.

Rocha, who pled guilty to conspiracy and money laundering charges, is scheduled to be sentenced on Dec. 7. While the charges each carry up to 20 years in prison, prosecutors have agreed to recommend a 40-month term based on his cooperation.

The 28-year-old's case stemmed from an investigation of TelexFree, a Massachusetts-based company that sold voice-over-internet telephone service and was founded by James Merrill, a U.S. citizen, and Carlos Wanzeler, a Brazilian.

Prosecutors said TelexFree was a pyramid scheme, making little to no money selling its service while taking in millions of dollars from thousands of people who paid to sign up to be "promoters" and post ads online for it.

TelexFree collapsed in 2014, inflicting more than $3 billion in losses on nearly 1.89 million people worldwide, prosecutors said.

Merrill was arrested in 2014. He was sentenced in March to six years in prison after pleading guilty to conspiracy and fraud charges.

Wanzeler in 2014 fled to Brazil, where he cannot be extradited from, leaving behind tens of millions of dollars he laundered from TelexFree accounts, prosecutors said.

In 2015, Leonardo Casula Francisco, Wanzeler's nephew, asked someone who became a cooperating witness to help transfer cash generated from the scheme that Wanzeler had hidden in the greater Boston area out of the United States, prosecutors said.

The pair agreed someone would be sent to the United States to deliver the money in increments to the witness, who would send it to accounts in Hong Kong where it would be transferred to Brazil, prosecutors said.

In December, Casula sent Rocha to the United States to deliver money to the witness, an indictment said.

After a Jan. 4 meeting in a parking lot where Rocha gave the witness $2.2 million in a suitcase, federal agents followed Rocha to a Westborough, Massachusetts, apartment complex, prosecutors said.

They said that after Rocha was arrested, he helped agents locate the apartment, where they found $17 million hidden under a mattress.

(Reporting by Nate Raymond in Boston; Editing by Bernadette Baum)