U.S. Rep. Joe Barton, R-Ennis, released a statement on Wednesday apologizing for a graphic nude photo of him that circulated on social media earlier this week.

"While separated from my second wife, prior to the divorce, I had sexual relationships with other mature adult women," he said. "Each was consensual. Those relationships have ended. I am sorry I did not use better judgment during those days. I am sorry that I let my constituents down."

It is still unclear how the photo got onto social media, who put it there, or whether its posting would constitute revenge porn, which is illegal under Texas law.

Barton, who announced his re-election bid earlier this month, is navigating in a political environment charged with emerging stories of sexual misbehavior in politics, in business and in the media. The photo, which appeared on an anonymous Twitter account, set off speculation within Texas GOP circles about his political future.

In a phone interview with The Texas Tribune on Tuesday, Barton said he was deliberating that.

"You're as aware of what was posted as I am," he said. "I am talking to a number of people, all of whom I have faith in, and am deciding how to respond, quite frankly."

A spokeswoman for Barton said Wednesday that he had no plans to resign and had filed for re-election.

Texas passed legislation in 2015 making revenge porn a class A misdemeanor, defining the crime as posting sexual or nude images or videos of non-consenting adults. Images taken by consenting adults with a "reasonable expectation of privacy" constitute "revenge porn" when distributed without the subject's consent, according to a blog post by Houston lawyer Brett Podolsky. Even threatening to distribute the material is illegal under state law.

Shannon Edmonds, a staff attorney with the Texas District and County Attorneys Association, said too many details of Barton's specific case were unknown to determine whether the leaked photo might constitute revenge porn under Texas law.

"What I can say is that the law was created in 2015 in part to kind of address situations like this, where an image that was taken during the course of a consensual relationship is later aired in public after that relationship has ended, usually ended badly," Edmonds said. "That’s exactly the kind of situation that brought about the new law."

Currently, there are no federal laws explicitly addressing revenge porn.

Podolsky told the Tribune that if the image was taken and shared in Washington, the District's laws would most likely apply. Washington classifies distributing explicit images without consent as a felony.

Barton, the former chairman of the powerful House Energy and Commerce committee, joined the House in 1985 and is the longest-serving member of Congress from Texas.

If Barton were to choose not to run for re-election, it would be sure to set off a frantic race to replace him. His 6th district, stretching from the Dallas-Fort Worth area into East Texas, is heavily Republican territory, so the GOP primary would be the battlefield. The filing deadline for the 2018 primaries is Dec. 11.

Soon after the news broke Wednesday, state Sen. Konni Burton, a Fort Worth Republican whose district overlaps with Barton's congressional district, batted down rumors that she might consider the seat.

"To supporters & donors who are asking me to make a congressional run & to those who are hearing the rumors, I thank you for thinking of me," Burton tweeted. "However, I am totally committed to SD10!"

Jana Lynne Sanchez, a Democrat running for Barton's seat, said in a statement that there was a "larger issue" than Barton's personal life at play.

“Texans, just like all American people, are tired of poor behavior of elected officials distracting us from the real issues affecting us – the unbearable cost of healthcare, the poor and sliding quality of public education and the lack of good jobs for our high school graduates," Sanchez said. "No matter who the Republican nominee is, I look forward to a civil and respectful campaign on the issues – not one sullied by personal attacks."

Barton's apology came near the end of what has already been a difficult year for him. As the manager of one of the congressional baseball teams, Barton and his two sons were on the field during practice in June when a gunman began firing. Barton recalled that his sons took cover during the shooting, one under an SUV and the other in the batting cage. He attributed his safety to the Capitol and Alexandria police officers on duty that day.

Patrick Svitek and Matthew Choi contributed to this report.