Rep. Joe Barton, R-Texas, said Thursday he will not seek re-election next year after a naked selfie and his private Facebook messages were made public.

Barton told the Dallas Morning News in an interview he will retire, a swift change from several weeks ago, when the long-time congressman said he planned to run again in 2018.

“I’ve always listened to people in Texas and worked for them in Washington, and I’ve been listening to a lot of people the last week in Texas,” Barton told the Dallas Morning News. “There are enough people who lost faith in me that it’s time to step aside and let there be a new voice for the 6 th District in Washington, so I am not going to run for re-election.”

In a statement, Barton praised his record in Congress and thanked his constituents and supporters.

"As a young Congressman, my slogan was 'listening to you in Texas, working for you in Washington.' For me that was never just a saying, but a commitment — a way of life," he said. "Over the last 33 years, I have held thousands of public meetings and visited with so many great people in Texas on issues important to them. In Washington, I have voted over 20,000 times on the House floor to hopefully make life a little better for the people in the 6th District.

"I am very proud of my public record and the many accomplishments of my office. It has been a tremendous honor to represent the 6th District of Texas for over three decades, but now it is time to step aside and let there be a new voice," Barton continued. "I am announcing today that I will not seek reelection in 2018. To the people of the 6th District, thank you for your support and friendship."

House Speaker Paul Ryan told reporters Thursday that he had spoken with Barton and was “going to continue speaking with him.”

Barton’s decision comes after an image of a naked man resembling the congressman was shared on social media last week. The Texas Republican, who was first elected in 1984, apologized for the image, and said he had “sexual relationships with other mature adult women” when he was separated from his second wife.

The Fort Worth Star-Telegram reported Tuesday that Barton had sent sexually charged Facebook messages with a Texas woman from 2012 to 2013.

In one of the messages, sent in June 2012, Barton asked the woman to “tell me what u r wearing or not wearing tonight miss sweet dreams.”

In a subsequent message sent more than a year later, in October 2013, Barton told the woman he was “not thinking good thoughts at this moment…blush.”

After the image was revealed, Barton faced mounting pressure from GOP leaders in his Texas district to resign.

Republican leaders in Tarrant County, Texas, reportedly asked Barton not to run for re-election next year during a meeting Monday, and Tim O’Hare, chairman of the Tarrant County Republican Party, said Barton should step aside.

“Since Mr. Barton’s highly-publicized issues have come to light, I have talked to numerous Republican activists, leaders, voters and elected officials about this situation — not a single one of them thinks he should run again,” O’Hare said in a statement. “I personally hope he learns from this and tries to be a better father and man.”