Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

WASHINGTON — GOP Rep. Tim Murphy of Pennsylvania, an anti-abortion lawmaker who allegedly urged his mistress to have an abortion when he thought she was pregnant, is resigning from Congress.

House Speaker Paul Ryan on Thursday announced Murphy's resignation, which takes effect Oct. 21.

Ryan, R-Wis., said he supports the resignation and said the decision was Murphy's.

"I've spoken to Tim quite a bit the last few days," Ryan told reporters at an event in Chestertown, Maryland. "I think it's appropriate he move on to the next chapter in his life."

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

On Wednesday, Murphy announced he would not seek re-election, saying he would "take personal time to seek help as my family and I continue to work through our personal difficulties."

He previously admitted an affair in a statement last month.

Murphy's decision came after the Pittsburgh Post-Gazette published text messages between Murphy and Shannon Edwards.

A Jan. 25 text message from Edwards told the congressman he had "zero issue posting your pro-life stance all over the place when you had no issue asking me to abort our unborn child just last week when we thought that was one of the options," according to the newspaper.

A text message from Murphy's number in response said his staff was responsible for his anti-abortion messages: "I've never written them. Staff does them. I read them and winced. I told staff don't write any more."

Edwards, it turned out, wasn't pregnant. Murphy recently acknowledged his affair with Edwards, which became public as a result of her divorce proceedings.

The revelation came as the House on Tuesday approved Republican legislation that would make it a crime to perform an abortion after 20 weeks of fetal development. Murphy, a member of the House Pro-Life Caucus, is among the bill's co-sponsors and voted for it.

The Post-Gazette also published a six-page memo apparently written by Murphy's congressional chief of staff and dated June 8, in which she accused Murphy of subjecting his staff members to "threats, hostility, anger and harassment."

Neither Murphy nor his office has commented on the newspaper report.

Murphy is serving his eighth term representing a district in southwestern Pennsylvania, including parts of suburban Pittsburgh. The district is a safe Republican seat, with Republican Donald Trump beating Democrat Hillary Clinton by a margin of three-to-two in last November's presidential election.