WASHINGTON — Representative Blake Farenthold, the Texas Republican who used $84,000 in taxpayer funds to settle a sexual harassment case with his former communications director, abruptly resigned from Congress on Friday afternoon.

In December, Mr. Farenthold, who represented the 27th District of Texas, said that he would not run for re-election amid scrutiny over the payment and accusations from other aides that he set the tone for a hostile work environment in his office. At the time, he was one of several lawmakers to announce his eventual departure from Congress after being accused of sexual harassment and discrimination.

“While I planned on serving out the remainder of my term in Congress, I know in my heart it’s time for me to move along and look for new ways to serve,” Mr. Farenthold said in a statement on Friday, thanking his staff, his family and the voters who elected him.

It was known for several years that Mr. Farenthold, already notorious for a heavily circulated photograph of him in duck pajamas, had been accused of sexual harassment by Lauren Greene, his former communications director. She sued him in 2014, claiming that he had illegally fired her after she complained about mistreatment.