A 24-year-old Apple employee was charged with creating fraudulent credit and debit cards and using them to buy nearly $1 million in the store's gift cards in Queens, prosecutors said Tuesday.

Ruben Profit, who had worked at Apple since 2013, was charged with second-degree grand larceny, first-degree criminal possession of a forged instrument, and third-degree criminal possession of stolen property. Profit was arraigned over the weekend and held in lieu of $20,000 bail.

"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," Queens District Attorney Richard Brown said in a statement. "The young man, a trusted employee who worked both as a salesperson and tech support, is accused of breaking that trust as well as the law."

Profit, of Cambria Heights, was accused of purchasing the Apple gift cards with Visa or American Express gift, debit, or prepaid cards between Aug. 2 and Octob. 15, according to prosecutors.

Profit, who started working at the Queens Center Mall store when it opened in July, allegedly told police he sold the $2,000 gift cards for $200 each. He made about $997,700 in the process, according to prosecutors.

The tech company realized what he was doing earlier this month when they started getting notified of charge-backs, or purchases that weren't paid by the credit card company because they were deemed fraudulent.

When he was arrested, Profit allegedly still had seven Apple gift cards on him.

Attorney information for Profit was not immediately available.

Profit's next court appearance is scheduled for Nov. 10.