Ruben Profit, 24, stole nearly $1 million in Apple gift cards, the DA said. View Full Caption DNAinfo/Nikhita Venugopal

ELMHURST — He was a real Genius.

An employee at the Queens Center Mall Apple store allegedly re-coded credit and debit cards to swipe nearly $1 million in Apple gift cards, which he then sold to others, according to the Queens district attorney's office.

Ruben Profit, 24, of Cambria Heights worked in sales and tech support with the company since 2013 and with the Elmhurst store since it opened.

He allegedly used American Express and Visa gift cards he had re-programmed to buy Apple gift cards worth a total of $997,700 — which he sold to black-market customers for $200 a pop — according to the DA.

“The defendant is accused of using his tech skills to rig the values on both American Express and Visa gift cards and then using them to purchase gift cards from his employer - The Apple Store," said DA Richard Brown in a statement.

The company became aware of the scam after receiving notifications about items charged back to the Apple gift cards, according to the criminal complaint.

When Profit was arrested he had 51 American Express and Visa gift cards on him, and allegedly told officers he was paid $200 for each $2,000 Apple gift card he gave to another person.

Profit was charged with grand larceny and nearly 50 counts of possession of a forged instrument, according to the DA.

He had a previous arrest for marijuana possession in 2013, records show.

Neither he nor his lawyer could immediately be reached for comment.