The artist behind Jeffrey Epstein’s now-viral portrait of Bill Clinton in a blue dress says she sold the painting at a Tribeca Ball fundraiser several years ago — and had “no idea” that Epstein was the one who had purchased it.

“In 2012, as a grad student at the New York Academy of Art, I painted pictures of Presidents Clinton and Bush as part of my master’s thesis,” explained Petrina Ryan-Kleid in a statement to The Post on Thursday.

“When the school put on a fundraiser at the Tribeca Ball that year, they sold my painting to one of the attendees. I had no idea who the buyer was at the time,” said Ryan-Kleid, a New York-based artist from Australia. “As with most of my paintings, I had completely lost track of this piece when it was sold seven years ago. So it was a complete surprise to me to learn yesterday that it wound up in Epstein’s home.”

Sources told The Post on Wednesday that Epstein — who was facing sex trafficking charges before his alleged suicide — had the oil painting hanging in his home for all to see.

“It was hanging up there prominently — as soon as you walked in — in a room to the right,” a source said. “Everybody who saw it laughed and smirked.”

A woman who visited the Epstein residence before his July arrest confirmed the existence of the Clinton painting to the Daily Mail. She was able to snap a picture of the painting with her cellphone.

In it, the former president can be seen lounging on a chair in the Oval Office, pointing toward the viewer, while wearing red heels and a blue dress similar to the one Monica Lewinsky famously wore during their White House hookup. Ryan-Kleid dubbed the painting “Parsing Bill.”

It was one of several bizarre art pieces that Epstein, 66, kept in his $56 million mansion.

The convicted pedophile also had a taxidermied tiger and poodle, a mannequin hanging from the ceiling — dressed in a wedding gown — and a $5.6 million painting of a woman cupping her bare breast.

“It was so odd,” recalled a hedge fund trader who once visited Epstein’s home.