At a gathering of Alabama Republicans last year, Katie Britt and her husband strategically positioned themselves at the end of a receiving line to shake hands with former President Donald J. Trump.Ms. Britt, a lawyer and former chief of staff for Senator Richard Shelby, had recently announced her campaign to fill the seat being vacated by her former boss, who is retiring. Mr. Trump had already endorsed her opponent, Representative Mo Brooks — but the couple hoped to sow some doubt in Mr. Trump’s mind, according to four people familiar with the encounter.As the couple greeted Mr. Trump, Ms. Britt’s husband, Wesley Britt — a burly retired N.F.L. lineman — mentioned to the former president that he had once played for the New England Patriots. “The only time you’ve met me, I think I was wrapped in a towel in the Patriots locker room,” Mr. Britt was said to have told Mr. Trump, who found it hilarious and replied that Robert K. Kraft, the team’s billionaire owner, “likes me very much.”From then on, Ms. Britt positioned herself as a formidable competitor with savvy political skills who persistently tried to convince Mr. Trump that she deserved his endorsement instead.In March, Mr. Trump gave Ms. Britt half of what she wanted, withdrawing his endorsement of Mr. Brooks — at that point far behind in the polls — because, he said, the far-right congressman had gone “woke.” Then, this month, with Ms. Britt clearly on track to prevail, the former president backed her, seemingly in an attempt to pad his endorsement record.Ten months after her brief exchange with Mr. Trump last August, Ms. Britt claimed victory in the Republican primary runoff for Alabama’s open Senate seat on Tuesday, capping a hard-fought campaign for her party’s nomination against Mr. Brooks. In a state with a deep-seated conservative bent, she is all but assured of winning in the general election in November.Ms. Britt is also one step closer to making history as the first woman in Alabama to be elected to the Senate. Her Democratic opponent is a pastor, Will Boyd, who has made unsuccessful runs for Senate, House and lieutenant governor.Shortly after the polls closed Tuesday, Mr. Shelby, who has known Ms. Britt since the days when she was an intern in his office, said he was overjoyed for her.“She is an outstanding person — she has got the brains, the drive and the compassion,” he said.Ms. Britt, 40, is seen as part of a younger generation of pro-Trump Republicans, and her husband’s banter with Mr. Trump was viewed by those familiar with the encounter as an astute move that proved essential to her nomination.Ms. Britt entered the primary with little name recognition and long odds against Mr. Brooks, who boasted more than a decade of experience in the House and gained Mr. Trump’s backing after he riled up the crowd at the former president’s rally before the attack on the Capitol on Jan. 6, 2021.But Mr. Trump rescinded his support for Mr. Brooks in March as Mr. Brooks struggled to gain traction under an avalanche of attack ads and criticism of his decision to urge an audience at a Trump rally to leave the 2020 election behind. “Katie Britt, on the other hand, is a fearless America First Warrior,” Mr. Trump said in a statement this month as he endorsed Ms. Britt.That move did not completely wipe out Mr. Brooks, who still managed to clinch a second-place finish in Alabama’s May 24 primary, garnering 29 percent of the vote. Ms. Britt pulled in 45 percent, short of the majority that would have avoided a runoff between the two top vote-getters.Ms. Britt fashioned herself as an “Alabama First” candidate, playing off Mr. Trump’s “America First” presidential campaign slogan, and centered her run on her Christian faith, hard-line border enforcement policies and ties to the business community.As an aide for Mr. Shelby, one of the Senate’s most senior members, she worked on some of his signature issues, including a sweeping Republican package of tax cuts in 2017, confirmation of conservative judges and a push for a border wall along the U.S.-Mexico border.She most recently served as the head of the Business Council of Alabama, a powerful lobbying group, and led a “Keep Alabama Open” campaign in November 2020 against coronavirus pandemic restrictions that required nonessential businesses to close or limit services. She also opened the council’s resources, typically reserved to paying members, to all small businesses amid the health crisis.On policy, Ms. Britt and Mr. Brooks had ideological differences: He represented a more aggressive brand of arch conservatism as a founding member of the Freedom Caucus while Ms. Britt, like Mr. Shelby, was seen as more focused on economic development. But in oratorical style, she echoed the hard-right talking points that have become commonplace messaging in the Republican Party.“When I look at what’s happening in Washington, I don’t recognize our country,” Ms. Britt said in a video introducing herself to voters. “The leftists are attacking our religious freedoms and advancing a socialist agenda. In Joe Biden’s America, people can collect more money staying at home than they can earn on the job.”The campaigns and supporters of Ms. Britt, Mr. Brooks and a third top competitor in the race, Mike Durant, a former Army pilot, spent millions of dollars on negative ads.Mr. Brooks and his supporters tried to paint Ms. Britt as a lobbyist and a RINO — a favored insult used by Trump supporters for politicians they believe are Republicans in name only.She shot back with attacks portraying Mr. Brooks as a career politician. It also helped that Mr. Brooks had a poor showing at Mr. Trump’s Alabama rally last August, just after Ms. Britt began her quiet campaign to sway the former president to her cause. What started as an enthusiastic response for Mr. Brooks that night turned to boos when he urged those in the audience to put the 2020 presidential election behind them and focus on 2022 and 2024.Mr. Trump called him back onstage for a second appearance, calling him “a fearless warrior for your sacred right to vote.”Later, when the former president took back his endorsement of Mr. Brooks, he said the congressman had made a “horrible mistake” with his comments at that fateful rally. More