He went from rags to riches — to handcuffs.

The New Jersey bodega owner who famously won a $338 million Powerball jackpot is now behind bars on charges he sexually assaulted a young girl, authorities said Wednesday.

Pedro Quezada, 49 — who hit the big one in 2013 and appeared on the cover of The Post with the headline “PAY-DRO” — allegedly victimized the girl for three years when she was between the ages of 11 and 14, Passaic County prosecutor Camelia Valdes said.

The child’s connection to Quezada was not immediately clear.

The Powerball winner, who now lives in Wayne, was charged with aggravated sexual assault, sexual assault and endangering the welfare of a child, authorities said.

After winning one of the highest-ever Powerball jackpots in New Jersey, Quezada, the ex-owner of the Apple Deli Grocery, took a lump-sum, post-tax payment of $152 million.

When he found out he held the winning ticket, “I felt pure joy and happiness because I can help my family,” the Dominican native said back on March 26, 2013, while claiming his prize.

“My life will change because it — so much money,” Quezada said, “but it will not change my heart.”

Quezada, who beat the 175-million-to-1 odds when he bought the winning ticket at a liquor store in Passaic, said at the time he was “very happy” and vowed to help his family.

“My family is a very humble family, and we are going to help each other out,” he was quoted saying.

Nearly $30,000 of his winnings were used at the time to pay child-support payments that he had owed since 2009.

Quezada again made headlines when his girlfriend of 10 years, Inez Sanchez, also the mother of one of his five children, had sued him for a cut of his winnings.

Sanchez eventually dropped the lawsuit.

Following his big win, Quezada’s Passaic landlord at the time claimed his tenant skipped out of town without paying the $7,250 rent that he owed.

“It doesn’t get any lower than that,” his ex-landlord Kujtim Sulejamni told the Daily Mail at the time.

Neighbors also charged that Quezada reneged on a promise to pay the rent for all the neighbors on his block for more than a month.

“He promised the whole street, but he never followed through,” his former neighbor Serafim Ariza told the Daily Mail.

If convicted on all three charges, Quezada could face 40 years in prison.

Quezada’s lawyer, Rafael Bentancourt, did not respond to a request for comment.