Rep. Tim Murphy (R-PA), a vocal opponent of abortion rights, submitted his resignation from Congress on Thursday, after the Pittsburgh Post-Gazette published text messages in which a woman said he had asked her to have an abortion.

“This afternoon I received a letter of resignation from Congressman Tim Murphy, effective October 21,” said House Speaker Paul Ryan, according to NBC News. “It was Dr. Murphy’s decision to move on to the next chapter of his life, and I support it.”

Murphy had previously announced that he would not seek reelection. “After discussions with my family and staff, I have come to the decision that I will not seek reelection to Congress at the end of my current term,” he said in a statement. “In the coming weeks I will take personal time to seek help as my family and I continue to work through our personal difficulties and seek healing. I ask you to respect our privacy during this time.”

Murphy is a member of the House Pro-Life Caucus and a sponsor of the Pain-Capable Unborn Child Protection Act, a 20-week abortion ban that passed in the House on Tuesday. In January, a post on his official Facebook page proclaimed “we’ve had great victories to protect the sanctity of life in the first weeks of this New Year!”

That post did not sit well with Shannon Edwards, the woman with whom Murphy was having an extramarital relationship, according to the Pittsburgh Post-Gazette.

“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,” she reportedly texted him on January 25.

The response, from Murphy’s phone number: "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."

The text messages were obtained by the Post-Gazette, which also acquired a memo apparently written by Murphy’s chief of staff, Susan Mosychuk, describing an “ongoing and ever more pronounced pattern of sustained inappropriate behavior” by Murphy.

The memo accuses Murphy of berating his legislative director and other staff during a June visit to his Pennsylvania district. “You called many of the work products that he literally gave up his weekend to produce as ‘useless,’” the memo states. “You pushed other documents off the table onto the floor because they weren't what you wanted. Then you got angry and demanded we find the documents that you had just thrown on the ground.”

The memo also charges that during the same visit, Murphy drove erratically, texting, reading his iPad, and watching YouTube videos while behind the wheel.

Murphy has not responded to the Post-Gazette’s requests for comment on the text messages. He has, however, admitted to a relationship with Edwards. Murphy, 64, met Edwards, a 32-year-old forensic psychologist, when she worked with him on a mental health bill passed last year, she told the Post-Gazette. She is in the process of a divorce; Murphy remains married.

Meanwhile, the Pain-Capable Unborn Child Protection Act, which bans abortions after 20 weeks nationwide except in cases of rape, incest, or a threat to the mother’s life, came up for a vote in the House on Tuesday. According to the Washington Examiner, Murphy voted for the bill, which passed in the House but is unlikely to pass in the Senate.

Murphy’s Facebook feed this year contains few mentions of abortion other than the post referenced in January. In that post, he praised President Trump’s reinstatement of the global gag rule and mentions his own sponsorship of a bill to prohibit the use of federal funds for abortion. “Passage of H.R. 7 in the wake of the President’s executive action gives me great hope that moving forward, we will once again be a nation committed to honoring life from the moment of conception and ensuring American taxpayer dollars are never spent to end a life before it even begins,” he wrote.

During Murphy’s 2012 campaign for reelection, his campaign issued a statement celebrating endorsements by anti-abortion groups. "I'm humbled and thankful to receive the endorsements of Pennsylvania's Pro-Life Federation and the National Right to Life PAC,” he said in the statement. “I am committed to upholding the sanctity of life, protecting the rights of the unborn and ensuring that federal tax revenues are never used to pay for abortions. Protecting life is a fundamental core value which I will champion in Congress 100% of the time."