Republican attorney and former White House ethics lawyer Richard W. Painter claimed that the FBI director “abused” his power and broke the law by sending a letter to congress saying that the FBI is taking additional “investigative steps” into Hillary Clinton‘s use of a private email server due to newly uncovered emails.

In a New York Times opinion piece published Sunday, Painter revealed that on Saturday he filed a complaint against director James Comey and the FBI for violating the Hatch Act, which ensures “that federal programs are administered in a nonpartisan fashion.”

Get push notifications with news, features and more.

“This letter, which was quickly posted on the internet, made highly unusual public statements about an F.B.I. investigation concerning a candidate in the election,” Painter wrote. “The letter was sent in violation of a longstanding Justice Department policy of not discussing specifics about pending investigations with others, including members of Congress. According to some news reports on Saturday, the letter was sent before the F.B.I. had even obtained the search warrant that it needed to look at the newly discovered emails. And it was sent days before the election, at a time when many Americans are already voting.”

With less than two weeks until Election Day, Painter said Comey’s claim that the FBI is looking into new emails pulled from the devices of top aide Huma Abedin and her estranged husband, Anthony Weiner, could influence the election’s outcome. The situation is further complicated because, as Comey said in his letter, the FBI does not yet know what the emails are or if they are linked to Clinton’s previous investigation.

“This is no trivial matter,” he concluded the piece. “We cannot allow F.B.I. or Justice Department officials to unnecessarily publicize pending investigations concerning candidates of either party while an election is underway. That is an abuse of power. Allowing such a precedent to stand will invite more, and even worse, abuses of power in the future.”

Image zoom Carlos Osorio/AP

Painter served as an ethics lawyer for George W. Bush’s administration for two years. In the piece, he revealed that he supported GOP candidates other than Trump during the primaries but has now pivoted to Clinton.

Many Democrats, including Nancy Pelosi, Clinton campaign chairman John Podesta and former Barack Obama chief of staff David Axelrod, have criticized Comey in recent days for his decision to send out the email without providing additional facts or information.

According to Fox News’ Bret Baier on Sunday, Weiner is cooperating with authorities in the FBI investigation and handed over his devices.