Former Apple lawyer Gene Levoff has been charged with insider trading by the SEC, which is accusing Levoff of exploiting his position at Apple to trade stocks ahead of earnings, via CNBC.

Ironically, before he was fired, Levoff worked as the head of the corporate law group at the company and was “responsible for Apple’s compliance with securities laws.” In other words, his job was to make sure that Apple and its executives didn’t do the exact thing that he was caught doing.

Levoff was “responsible for Apple’s compliance with securities laws”

According to the SEC’s lawsuit, Levoff traded based on insider knowledge on at least three occasions in 2015 and 2016. He also had a history of insider trading, with at least three additional infractions in 2011 and 2012. The largest of those breaches took place in July 2015, when Levoff received information that Apple would miss its third quarter estimates for iPhone sales. As the lawsuit details, “Between July 17 and the public release of Apple’s quarterly earnings information on July 21, Levoff sold approximately $10 million dollars of Apple stock – virtually all of his Apple holdings – from his personal brokerage accounts. By trading on this material nonpublic information, Levoff avoided approximately $345,000 in losses.”

In total, the SEC claims that Levoff avoided loses of approximately $382,000 through his insider trading. Levoff no longer works at Apple — he was placed on leave in July 2018 and was fired in September — but it’s still a bad mark to associate with the company, especially given that Levoff was the one who was responsible for instituting many of the rules that he himself broke.

The full SEC complaint can be viewed below: