Rep. Charlie Dent (R-Pa.) talks to reporters at the U.S. Capitol on July 28, 2017. (Oliver Contreras for The Washington Post)

Rep. Charlie Dent (Pa.), a frequent critic of President Trump and a leader of the GOP’s moderate bloc in the House, said Tuesday that he will resign from Congress within weeks. His decision could set up a costly special election if the Democratic governor of Pennsylvania orders one.

Dent had already announced his retirement from Congress in September, citing personal reasons for the decision while also lamenting the marginalization of the “governing wing” of the Republican Party as the GOP has moved further to the right.

He said in a statement released Tuesday morning that he will leave “in the coming weeks.” He did not offer a reason for his decision to depart now rather than finish his term.

“Actively engaging in the legislative and political process presents challenges, and in so doing, I believe I have had a positive impact on people’s lives and made a difference in Congress,” he said. “I am especially proud of the work I have done to give voice to the sensible center in our country that is often overlooked or ignored. It is my intention to continue to aggressively advocate for responsible governance and pragmatic solutions in the coming years.”

Dent, 57, is a co-chairman of the Tuesday Group, made up of several dozen centrist House Republicans, and he is chairman of the House Appropriations subcommittee on military construction, veterans affairs and related agencies.

His decision to resign in the coming weeks could set up a competitive and costly special election, depending on the wishes of Gov. Tom Wolf.

Pennsylvania election law requires the governor to issue a writ of election within 10 days of a vacancy, with an election to follow “not less than sixty days” later. Although the election could be held during “the next ensuing primary or municipal election,” Pennsylvania’s primary will be held May 15 — before any special election could be called. It is not clear whether Wolf would schedule an election so soon before the November midterm election will bring a full-term replacement for Dent.

Wolf’s office said in a statement Tuesday that once the governor receives an official resignation notice, “he will make a formal decision regarding scheduling the date of a special election.”

A special election called before the Nov. 6 general election could force Republicans to spend millions to defend the seat. Democrat Conor Lamb won a March special election in Pennsylvania’s 18th Congressional District, which Trump had won by 20 points in 2016. Dent’s district is much more competitive for Democrats — it went for Trump by eight points — and it is set to become even more competitive after a court-ordered redistricting. But a special election would fill the seat based on the existing lines.

In a statement, Wolf praised Dent as “a voice of reason and civility that breaks through the chaos and partisanship of Washington.”

“I thank Representative Dent for his service to our country and commonwealth,” he added. “While we do not agree on everything, Charlie has always been approachable, and he has always put his constituents above partisan politics.”