US congresswoman Martha Roby has won Alabama’s Republican run-off in a mid-term contest that hinged on loyalty to Donald Trump, despite fallout from her previous criticism of the US president.

The four-term incumbent will now represent the Republicans on the November ballot, having defeated Bobby Bright, a former Democrat who tried to cast himself as the more authentic Trump ally in the low-turnout Republican contest.

The Trump White House was on Ms Roby’s side.

Martha Roby
Ms Roby hugs her mother-in-law after her triumph (AP)

She told supporters: “It’s been a true privilege to have the support of the White House through this campaign.

“I am so humbled that the people of Alabama’s 2nd Congressional District have again placed their trust and their confidence in me.”

Mr Trump and US vice president Mike Pence endorsed Ms Roby in recent weeks. Mr Pence went further over the weekend and recorded automated calls distributed on her behalf, saying she is a reliable vote for the Trump agenda.

Some intervention was required after Ms Roby angered Alabama Republicans in the closing days of the 2016 presidential election when she said Mr Trump’s lewd comments about women – captured on an Access Hollywood tape – made him unacceptable as a candidate for president.

She has spent much of the last two years trying to convince her constituents in Alabama’s 2nd Congressional District that she is sufficiently loyal to the president.

Bobby Bright
Bobby Bright had portrayed himself as more of a Trump supporter (AP)

Mr Trump’s support did not guarantee a victory, even in a deep-red district that overwhelmingly backed him two years ago. The president has a mixed record this primary season, having backed a handful of Republican candidates in friendly districts who ultimately lost.

The most noteworthy, perhaps, was Alabama’s own Republican Senate candidate Roy Moore, who earned the president’s strong backing but suffered an embarrassing loss just eight months ago.

Voters indicated they were willing to move past Ms Roby’s criticism of Mr Trump.

Ms Roby faced the run-off test because she earned only 39% of the vote in the first primary contest back in June. Mr Bright was the second-place finisher.

Despite her past criticism of Mr Trump, the White House eventually emerged as Ms Roby’s most powerful backer.

Mr Trump called Ms Roby a “reliable vote for our Make America Great Again Agenda” on Twitter, and excoriated Mr Bright for being “a recent Nancy Pelosi-voting Democrat”.

The president was referring to Mr Bright’s support of Ms Pelosi’s bid to become House speaker when he was a Democrat in congress.

Ms Roby made clear she would return the favour should she win re-election in November, as widely expected in a heavily Republican state. She will face Democrat Tabitha Isner, a political newcomer.