Peter Strzok, the senior FBI counterintelligence agent who has been a lightening rod President Trump and his allies in Congress, will appear voluntarily Wednesday before House lawmakers, dodging a subpoena by a top Republican chairman.

Strzok, who was part of the FBI’s investigations of Hillary Clinton’s pirate email and the Trump campaign’s possible connections with Russia, will meet with the House Judiciary and Oversight Committees, an aide for the former told the Washington Examiner.

The interview will be held privately behind closed doors, even as President Trump has demanded it be public.

There are talks to hold a public hearing, the aide said.

Strzok’s voluntary appearance avoids, for now, a subpoena issued last week by House Judiciary Committee Chairman Bob Goodlatte.

Earlier this month, Strzok’s lawyer said he would voluntarily appear and testify before House Judiciary, and “any other Congressional committee that invites him.” But Goodlatte said last week that because Strzok hadn't pinned down a time for testimony he was "imminently going to issue a subpoena for him to appear next week."

Aitan Goelman said the idea that Strzok would have to be subpoenaed to appear is “wholly unnecessary.”

Strzok was removed from special counsel Robert Mueller probe after it was discovered he and his mistress, a former FBI lawyer Lisa Page, exchanged anti-Trump, pro-Clinton messages.

Texts — many of which were already made public before the Justice Department’s inspector general report — between the two included their thoughts about the 2016 presidential election, and harsh criticisms of then-candidate Trump, calling him words like “idiot,” ”loathsome,” ”menace,” and “disaster."

The IG made public a newer, more inflammatory text where Page wrote to Strzok in August 2016: “[Trump’s] not ever going to become president, right? Right?!”

Strzok responded: “No. No he won’t. We’ll stop it.”

The IG concluded that Strzok’s text, along with other disparaging messages, “is not only indicative of a biased state of mind but, even more seriously, implies a willingness to take official action to impact the presidential candidate’s electoral prospects.”

The text messages “potentially indicated or created the appearance that investigative decisions were impacted by bias or improper considerations,” the IG report said.

The inspector general, Michael Horowitz, referred his findings on Strzok to the FBI’s Office of Professional Responsibility for possible disciplinary measures.

The top Democrat on the House Intelligence Committee Adam Schiff said Tuesday that his panel is in talks to bring Strzok in to testify, too.