President Donald Trump on Friday endorsed a Republican lawmaker who disavowed him following the 2016 revelation of a tape in which he bragged about groping women.

In a tweet, Trump backed Rep. Martha Roby, an Alabama Republican facing a primary runoff next month for her 2nd District seat. The president called the fourth-term representative "a reliable vote for our Make America Great Again Agenda."

Trump also criticized Roby's GOP opponent Bobby Bright, who previously represented the 2nd District as a Democrat for one term.

Trump tweet: Congresswoman Martha Roby of Alabama has been a consistent and reliable vote for our Make America Great Again Agenda. She is in a Republican Primary run-off against a recent Nancy Pelosi voting Democrat. I fully endorse Martha for Alabama 2nd Congressional District!

Trump's endorsement of Roby is curious considering the president's harsh treatment of other Republican lawmakers who criticize him. In GOP primaries in red pockets of the country, candidates have tied themselves closely to Trump. Some occasional Trump critics such as Roby have appeared to suffer electorally in areas where the president is popular.

After the "Access Hollywood" tape of Trump surfaced in 2016, Roby rescinded her endorsement of his presidential candidacy.

"Donald Trump's behavior makes him unacceptable as a candidate for president, and I won't vote for him," she said in a statement at the time.

Throughout the primary campaign, Bright has used Roby's renunciation of Trump against her. In one campaign ad, he says she "turned her back" on Trump.

In the 2nd District House primary this month, Roby garnered 39 percent of the vote, versus 28 percent for Bright. It was considered a disappointing result for Roby, who failed to reach the 50 percent threshold needed to avoid a runoff. The candidate who emerges from the GOP primary will be considered a heavy favorite to win the red southeastern Alabama seat.

Trump's endorsement of Roby stands in stark contrast to his treatment of another Republican who has criticized him. Earlier this month, the president endorsed GOP Rep. Mark Sanford's primary opponent, saying the South Carolina Republican "has been very unhelpful to me." State Rep. Katie Arrington eventually defeated Sanford in the primary.

Trump even mocked Sanford this week during a meeting with House Republicans. He then tweeted that lawmakers "applauded and laughed loudly" at his comments about Sanford. Multiple Republicans disputed the president's characterization and said his comments were met with awkward silence, then some boos.

Sanford has said Trump has a negative effect on political discourse and civility in the U.S. This week, he called Trump's tweet "systemic of a larger cancer, which we've all come to just sort of blithely accept the fact that the highest office holder in the land can multiple times a day say something that isn't true."

It is unclear why Trump overlooked Roby's past criticism. The president could simply support the representative because she has voted with his priorities about 98 percent of the time, according to FiveThirtyEight. That compares with about 71 percent of Sanford's votes that have aligned with Trump.

Trump has publicly mocked other Republicans who criticize him, such as Sen. Bob Corker, R-Tenn.

The president tweeted a string of other endorsements Friday morning.

He backed South Carolina Gov. Henry McMaster in his bid for re-election. Trump heads to South Carolina to hold a rally in support of the governor next week.

The president also endorsed Rep. Ron DeSantis for Florida governor.