BOSTON - A photo tweeted by police in the US takes the idea of stashing money under your mattress to a whole new level.

Officers found US$20 million (S$28 million) stashed inside a bed frame under a mattress in a Massachusetts flat that is believed to be linked to a US$1 billion pyramid scheme involving TelexFree, a company that claimed to provide Internet phone services, reported the BBC.

Investigators uncovered the cash while following a Brazilian man, who was charged in connection with the haul.

Photo of $20M seized in box spring following arrest of Brazilian national in scheme to launder proceeds of TelexFree https://t.co/ulmFXtI9mr pic.twitter.com/0MTHxjaVZL — U.S. Attorney MA (@DMAnews1) January 23, 2017

Federal prosecutors say the defunct company swindled almost a million people worldwide out of about US$1 billion.

The US attorney's office in Massachusetts tweeted a photo of the windfall of cash, which was found at the flat of Brazilian national Cleber Rene Rizerio Rocha, 28, in Westborough, Massachusetts.

Rocha was arrested and charged with conspiring to commit money laundering.

A judge on Monday ruled that Rocha was a flight risk and held him without bail, said the BBC.

Prosecutors say Rocha was part of the scheme, transferring millions of dollars to Brazil by laundering the cash through Hong Kong.

TelexFree, which purported to sell Voice over Internet Protocol (VoIP) services, allegedly made most of its revenue from people buying into the company scheme with the promise of payouts for posting online ads, according to federal prosecutors.

Those investors were then compensated with money from new recruits, who were often friends and family members.

"TelexFree purported to aggressively market its VoIP service by recruiting thousands of 'promoters' to post ads for the product on the Internet," the Department of Justice said in a statement on its website.