A former top lawyer at Apple is facing federal charges of insider trading related to private information he allegedly used to trade on Apple’s shares over a five-year period.

On Wednesday, the U.S. Securities and Exchange Commission and the Department of Justice charged Gene Levoff, Apple’s former corporate secretary and director of corporate law, with fraud. The agencies are seeking the return of profits he made using inside company information, as well as interest and penalties; they also want a ban on Levoff serving as a corporate officer or director due to actions he allegedly took over three business quarters in 2015 and 2016. The SEC says that during those specific periods, Levoff used confidential information about Apple’s earnings to make stock trades ahead of earnings reports that resulted in him seeing a combination of $382,000 in profits and losses avoided.

The SEC said that Levoff’s actions were especially egregious as he was “responsible for securities laws compliance at Apple, including compliance with insider trading laws.”

“Levoff’s alleged exploitation of his access to Apple’s financial information was particularly egregious given his responsibility for implementing the company’s insider trading compliance policy,” said Antonia Chion, associate director of the SEC’s Division of Enforcement. “The SEC is committed to pursuing insiders who breach their duties to investors.”

Separately, the Department of Justice filed fraud charges against Levoff for actions that allegedly were taken between February 2011 and April 2016. In a statement, the DOJ didn’t refer to Apple by name, but instead cited Levoff as formerly working for “a global technology company headquartered in Cupertino, California” that it also referred to as “Company-1” on numerous occasions.

The DOJ said that over the five-year period, Levoff, working then as “the top corporate attorney at Company-1,” ran a scheme designed to defraud the company and its shareholders in which he “allegedly misappropriated material, nonpublic information about Company-1’s financial results and then executed trades involving the company’s stock.” The DOJ said Levoff’s actions allowed him to “realize profits of approximately $227,000 and to avoid losses of approximately $377,000” between 2011 and 2016.

The DOJ charges carry a maximum penalty of 20 years in prison and a fine of $5 million.

Apple didn’t immediately return a request for comment.