The chairman of North Carolina’s elections board has resigned following complaints about comments he’s made online criticizing President Donald Trump.

Andy Penry resigned Saturday from the State Board of Elections and Ethics Enforcement. The Democrat said he was leaving the board because he did not want to undermine an ongoing probe of potential wrongdoing in the state’s 9th Congressional District. The board is investigating alleged fraudulent activity related to mail-in absentee ballots and could order a new election.

Wake County GOP Chairman Charles Hellwig filed a complaint Wednesday and provided images of what appear to be tweets from Penry’s account this year criticizing Trump and a proposed constitutional amendment. Hellwig cited state law prohibiting board members from publicly opposing candidates and referendums.

Penry’s resignation was first reported by The Washington Post.