Updated at 6 p.m. ET

Republican Rep. Tim Murphy of Pennsylvania will resign from Congress after a report said he asked a woman with whom he had an extramarital affair get an abortion.

On Wednesday, Murphy had initially said he would simply not seek re-election in 2018. But the next day, House Speaker Paul Ryan announced that Murphy had sent his resignation letter, effective October 21st.

"It was Dr. Murphy's decision to move on to the next chapter of his life, and I support it," Ryan said in a statement. "We thank him for his many years of tireless work on mental health issues here in Congress and his service to the country as a naval reserve officer."

Murphy is a member of the House Pro-Life Caucus and has voted to impose more restrictions on abortion access. Earlier this week, Murphy voted in favor of the Pain-Capable Unborn Child Protection Act, which "would ban abortions after 20 weeks of pregnancy," according to GovTrack.

The Pittsburgh Post-Gazette said it obtained a record of a text message sent by Shannon Edwards, a forensic psychologist in Pittsburgh, to Murphy in January.

"And you have 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," the newspaper quoted Edwards as writing about a Facebook post from Murphy's office.

The Post-Gazette said a text from Murphy's cellphone number in response says, "I get what you say about my March for life messages. I've never written them. Staff does them. I read them and winced. I told staff don't write any more. I will."

In the end, it turned out Edwards was not pregnant.

The affair came to light a month ago after a divorce proceeding involving Edwards and her husband was unsealed by a judge. Murphy admitted to the affair shortly after.

"Last year I became involved in an affair with a personal friend. This is nobody's fault but my own, and I offer no excuses," Murphy said in a statement through his attorney to the Post-Gazette. "To the extent that there should be any blame in this matter, it falls solely upon me."

Murphy has opposed using federal funding to cover abortions. He spoke at the Right to Life Convention in Pittsburgh in 2010, Katie Blackley of WESA reports for NPR, saying:

"Every kids deserves a chance to have a choice at life. Every child deserves a chance to have a choice at life. Every baby deserves a chance to have a choice at life. And every parent should be supported in their responsibility and commitment to raise that child."

Murphy is in his eighth term in Congress representing the heavily Republican 18th District of Pennsylvania, in the southwest of the state. He is a practicing psychologist and has worked on legislation to overhaul mental health programs.

The vacancy will now trigger a special election. But in a district which President Trump carried by 20 points in 2016, it won't be an easy target for Democrats.

"As I said last night, the circumstances surrounding this situation are extremely disappointing to me," National Republican Congressional Committee Chairman Steve Stivers said in a statement Thursday. "However, the NRCC is undefeated in special elections this year and I'm supremely confident that will continue. In the meantime, we look forward to seeing how national Democrats can spin yet another special election loss into a so-called 'moral victory.'"

Democrats, however, said they would be watching the race regardless.

Copyright 2017 NPR. To see more, visit http://www.npr.org/.