Rep. Blake Farenthold, R-Texas, will not run for re-election following allegations of sexual harassment and inappropriate behavior, the lawmaker announced Thursday.

"I'm announcing my decision not to run for re-election," Farenthold said in a Facebook video posted Thursday morning. He denied the allegations made by several former staffers, but said that nonetheless, they had become "a political distraction. ... My constituents deserve better."

House Speaker Paul Ryan endorsed Farenthold's decision not to run for re-election, telling reporters the congressman was "making the right decision to retire."

Two Republican sources told NBC that top House Republicans spoke with Farenthold in recent days about the allegations, including Ryan and Rep. Steve Stivers, who chairs the House Republicans' campaign fundraising committee.

The House Ethics Committee recently announced that it had opened an investigation into claims that Farenthold sexually harassed congressional staffers who worked in his office. Two of his former aides, Lauren Greene and Michael Rekola, have spoken publicly, alleging that Farenthold engaged in sexually inappropriate behavior.

A spokesman for Farenthold did not immediately respond to questions from CNBC.