HARRISBURG — Pennsylvania Republican Party Chairman Val DiGiorgio resigned Tuesday after The Inquirer reported that he had traded sexually explicit messages with a onetime GOP candidate for Philadelphia City Council.

In a statement, DiGiorgio, 51, said his communications with candidate Irina Goldstein were “entirely consensual,” and that any accusations that he engaged in harassment or abuse of power are “fundamentally untrue.”

DiGiorgio, a Chester County lawyer, also wrote that “the attempt to represent these communications as anything other than [consensual] came only after I declined to support her candidacy and take sides in the party primary.” He added: “I intend to vigorously defend myself against these assertions and protect my family, my colleagues, and the party from this private matter. I extend my deepest apologies to my family and colleagues for this unfortunate distraction.”

In an interview Tuesday, Goldstein said it was appropriate for DiGiorgio to step down.

“When a person has that much clout and power, I feel he abused that. And that was not necessary,” she told The Inquirer.

About her decision to share the flirtatious and explicit online messages they exchanged, she said: “I was damned if I did, I was damned if I didn’t.” She added: “I just wanted the information to be out there.”

Pennsylvania stands to be a critical swing state in the 2020 presidential election. The head of the state party, chosen by fellow Republicans, is the face of the GOP, which counts roughly 3.2 million registered voters, and plays a key role in fundraising and mapping political strategy.

With DiGiorgio’s departure, vice chair Bernadette Comfort becomes the acting head of the state GOP. Under party rules, she has 10 days to schedule a party meeting to select a new chair — a gathering that then must occur within 45 days.

Comfort, a Philadelphia native raised in the Lehigh Valley, has served as a committeewoman for the Lehigh County Republican Committee and a state committee member. She also worked as executive director of the Anne B. Anstine program, which trains Republican women to run for office or serve in other government roles.

In a statement, Comfort wished DiGiorgio well, and said she would be focused on winning open appellate seats in the fall, then helping President Donald Trump again win the state, as he narrowly did in 2016. “I will not rest until we win Pennsylvania — and reelection — for the president,” she wrote.

There is bound to be a contest for the party’s top political job. Several names already have been floated in Republican political circles, including former U.S. Rep. Lou Barletta, a Trump ally who lost a Senate bid last year.

In an interview Tuesday, Barletta said he had heard from “supporters” urging him to run for GOP chairman. But he said he had not had any “formal discussions” about running, and had not made any decisions. “I’m just digesting what’s happening,” Barletta said.

Also mentioned as a possible candidate was Philadelphia lawyer Lawrence Tabas, the party’s onetime general counsel, who lost the post to DiGiorgio in a hotly contested election in February 2017.

In an interview, Tabas said he had received “an outpouring of support” from party members wanting him to run, and would make a decision by week’s end. “I’m taking some time to process these events before I make a final decision,” he said.

DiGiorgio, a lawyer with the Philadelphia firm Stradley Ronon, had pledged to increase Republican influence in the counties surrounding Philadelphia, where support for Trump was less vigorous than in more working-class counties and rural areas of the state.

During his tenure, Republicans experienced several tough political losses. Last year’s midterm election in particular was devastating to Republicans. In that race, Democrats picked up four seats in Congress and chipped away at GOP majorities in the state legislature. Gov. Tom Wolf and U.S. Sen. Bob Casey, both Democrats, won reelection by wide margins.

In some of his messages to Goldstein, reviewed by The Inquirer, DiGiorgio expressed a weariness about politics.

“It’s a soul-sucking business,” he wrote. “You bend a rule here. And compromise your principles there. You lose yourself.”

In another, from December of last year, DiGiorgio wrote, “It’s a lousy business,” adding: “If I had to do it again I would have taken another path.”

Staff writer Jonathan Tamari contributed to this article.