Rep. Martha Roby (R-Ala.) was critical of then-candidate Donald Trump during the 2016 election campaign. (Mickey Welsh/AP)

President Trump has offered his support to a pair of contested Republicans in Alabama and Florida, endorsing a congressional candidate who was highly critical of Trump’s alleged sexual improprieties and a gubernatorial candidate who is trailing in the polls.

In Friday morning tweets, Trump announced his backing for Rep. Martha Roby (Ala.), who is seeking reelection, and Rep. Ron DeSantis (Fla.), who is running for governor.

The endorsements come on the heels of Trump’s late-hour involvement this month in a GOP congressional primary in South Carolina, where a tweet just three hours before the polls closed may have helped sink the reelection bid of Rep. Mark Sanford.

Roby, who faces a runoff next month, called on Trump to step aside as the Republican presidential nominee in 2016 after an “Access Hollywood” tape surfaced in which Trump bragged about grabbing women’s genitals.

“I cannot look my children in the eye and justify a vote for a man who promotes and boasts about sexually assaulting women,” Roby said at the time.

In his tweet, Trump made no mention of the criticism and said that Roby 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 wrote.

Roby faces Bobby Bright, a former congressman who served one term as a Democrat but switched parties to run against Roby in this year’s GOP primary.

In a separate tweet Friday, Trump endorsed DeSantis for Florida governor. A Fox News poll released Thursday showed DeSantis trailing Florida Agriculture Commissioner Adam Putnam, 32 percent to 17 percent, in the Republican primary, with a large number of voters undecided.

In December, Trump praised DeSantis in a tweet but stopped short of endorsing him in the race to succeed Gov. Rick Scott (R-Fla.), who is term-limited. DeSantis is a tea party conservative and an outspoken critic of special counsel Robert S. Mueller III’s investigation into ties between Russian involvement in the 2016 election and the Trump campaign.

In his tweet Friday, Trump said that DeSantis “has my full Endorsement!”

“Ron is strong on Borders, tough on Crime & big on Cutting Taxes — Loves our Military & our Vets,” Trump wrote.

In the South Carolina race this month, Trump urged GOP voters to back Sanford’s primary opponent, state legislator Katie Arrington. “Mark Sanford has been very unhelpful to me in my campaign to MAGA,” Trump tweeted. “He is MIA and nothing but trouble. He is better off in Argentina. I fully endorse Katie Arrington for Congress in SC, a state I love. She is tough on crime and will continue our fight to lower taxes. VOTE Katie!”

Trump’s mention of Argentina was a reference to the 2009 scandal in which Sanford, then South Carolina’s governor, admitted he was having an affair with an Argentine journalist.

After his primary loss this month, Sanford told The Washington Post’s Karen Tumulty that Trump’s tweet would probably serve as a potent warning to other Republicans in primary battles this year not to cross the president.

“They don’t want the tweet that I got last night,” Sanford said.

On Monday, Trump is planning to insert himself into another contested GOP race in South Carolina. He is scheduled to travel to the Palmetto State to campaign with South Carolina Gov. Henry McMaster (R) a day before Tuesday’s runoff election.

McMaster, whom Trump has supported before, faces businessman John Warren.