The raunchy text messages that went from Jeff Bezos’ phone to the pages of the National Enquirer — and from there to media outlets around the world — came from the brother of the Amazon CEO’s girlfriend, federal sources confirmed Friday to the Wall Street Journal.

The text messages, which included a nude photo of Bezos and sexually suggestive photos of the girlfriend, Lauren Sanchez, had been given by Sanchez to her brother, who then leaked them to the Enquirer, sources familiar with a related federal probe told the Journal.

The brother, Michael Sanchez, then sold the photos and texts to the Enquirer, the sources said.

The brother has denied he sold his sister’s lewd texts to the Enquirer, but the Journal reported that federal prosecutors in Manhattan have evidence linking him to the sale.

The prosecutors are probing whether the Enquirer’s publisher, American Media, Inc., tried to use the texts to blackmail Bezos, who owns the Washington Post.

In a post on Medium last February, the then-married billionaire accused National Enquirer publisher David Pecker of trying to force him to stop investigating the tabloid’s recent expose of his affair with Sanchez.

Prosecutors are also investigating if Bezos’ phone was hacked, as the Amazon CEO has suggested.

The Guardian newspaper reported last week that Saudi Crown Prince Mohammed bin Salman allegedly “hacked” Bezo’s phone by sending him a malicious video file via the chat platform WhatsApp.