Gene Daniel Levoff, a former lawyer in charge of Apple Inc.'s insider trading policy, exits from federal court in Newark, New Jersey, U.S., on Wednesday, Feb. 20, 2019.

Former Apple lawyer Gene Levoff was indicted on insider trading charges, the U.S. Attorney in New Jersey said in a press release on Thursday.

The government in its indictment alleges that Levoff used inside information from Apple, including financial results before they were published, to trade Apple stock. He's facing six counts of securities fraud and six counts of wire fraud.

"This scheme to defraud Company-1 and its shareholders allowed Levoff to realize profits of approximately $227,000 on certain trades and to avoid losses of approximately $377,000 on others," according to the press release.

It continued: "When Levoff discovered that Company-1 had posted strong revenue and net profit for a given financial quarter, he purchased large quantities of stock, which he later sold for a profit once the market reacted to the news."

Levoff was one of Apple's top lawyers. He started at Apple in 2008 and was a senior director of corporate law from 2013 until 2018, according to the indictment. The trades mentioned in the indictment occurred between 2011 and 2016.

One of his responsibilities at Apple was making sure that Apple employees didn't do any insider trading. "Levoff's responsibilities included ensuring compliance with Company-1's Insider Trading Policy," according to the indictment.

The indictment alleges that Levoff traded stock during a "blackout" period, when employees can't buy or sell stock, and that he informed Apple employees about the blackout period during the same time frame he was trading Apple stock.

The SEC previously charged Levoff in February in a civil case. Thursday's indictment is criminal, and each count carries a maximum penalty of 20 years in prison in addition to fines.

Apple declined to comment.

"After being contacted by authorities last summer we conducted a thorough investigation with the help of outside legal experts, which resulted in termination," Apple said about the case in February.

"We look forward to vigorously defending Mr. Levoff with respect to these allegations," Kevin Marino, Levoff's lawyer, told CNBC.

CNBC's Jim Forkin contributed to this story.