Shrugging off the president’s “unacceptable” behavior toward women does have its benefits. Photo: Bill Clark/CQ-Roll Call,Inc.

Congresswoman Martha Roby proved on Tuesday night that Republican lawmakers can criticize Donald Trump and survive — if they go on to vote in line with the president 96.5 percent of the time.

Roby, who is seeking a fifth term in Alabama, was forced into a runoff during last month’s GOP primary. In that race, Roby received 39 percent of the vote, and Democrat-turned-Republican Bobby Bright received 28 percent.

But on Tuesday night, Roby beat Bright easily, taking 67 percent of the vote to his 32 percent in the runoff.

During the campaign, Bright hammered Roby for withdrawing her support from Trump following the release of the Access Hollywood tape.

Donald Trump's behavior makes him unacceptable as a candidate for president, and I won't vote for him.



Full statement: pic.twitter.com/Ge7GU1TSvm — Rep. Martha Roby (@RepMarthaRoby) October 8, 2016

When that assessment proved to be wrong, Roby spent the next 18 months trying to prove her loyalty to this “unacceptable” president. It worked, with Trump and Vice President Mike Pence endorsing her in the race. Outside Republican groups also poured large sums of money into her campaign.

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! — Donald J. Trump (@realDonaldTrump) June 22, 2018

The congresswoman was quick to thank the White House on Tuesday night. “Sincere thanks to President Trump and Vice President Pence,” she told supporters at her victory celebration. “I am so humbled that the people of Alabama’s Second Congressional District have again placed their trust and their confidence in me.”

Roby will face Democrat Tabitha Isner, a business analyst and first-time candidate, in November. The Republican is heavily favored to win the race, as Trump won the district by 31.7 points in 2016.