PHOENIX — Arizona’s governor has named Rep. Martha McSally to replace U.S. Sen. Jon Kyl in the U.S. Senate seat that belonged to Sen. John McCain.

Republican Gov. Doug Ducey announced Tuesday that McSally will take over after Kyl’s resignation becomes effective Dec. 31. McSally lost the Senate race to Democratic Rep. Kyrsten Sinema.

“With her experience and long record of service, Martha is uniquely qualified to step up and fight for Arizona,” Ducey said in a statement. “I thank her for taking on this significant responsibility and look forward to working with her and Senator-Elect Sinema to get positive things done.”

McSally will serve until the 2020 election, when voters will elect someone to serve the final two years of McCain’s term.

Kyl was appointed after McCain’s death from brain cancer in August. He previously served in the Senate for Arizona and had said he would only commit to serving until the end of 2018.

The appointment puts Arizona back in the political spotlight just a month after Democrats won their first statewide race in a decade. Democrats hope that the state swings again in 2020 and are expected to target it both in the presidential race and the contest for McCain’s seat.

U.S. Rep. Ruben Gallego, former astronaut and current gun control advocate Mark Kelly and former Arizona Attorney General Grant Woods, who left the GOP this year, have all considered running as Democrats for the post.

The intense interest in the seat was a factor in Ducey’s convoluted decisions. He initially appointed Kyl while the governor himself was campaigning for re-election. By picking Kyl, Ducey dodged tough political decisions that could have complicated his own re-election bid.

McSally is a two-term congresswoman who was long considered for the Senate by the state’s GOP establishment. The first female combat pilot, McSally rose to the rank of colonel in the Air Force before entering politics. She got a taste for it through working for Kyl’s office as a national security aide.

McSally represented a swing district in Tucson that voted for Hillary Clinton in 2016. She carved out a reputation as a moderate who could win tough elections. That went out the window during her Senate campaign this year. She had been critical of President Donald Trump in 2016 but praised him during the midterm election. Facing a primary challenge from her right, McSally embraced a tougher stance on immigration.

But McSally was unable to defeat Sinema, despite playing up her military record against a Democrat who had once been an anti-war activist. McSally even contended that Sinema committed “treason” for saying she “didn’t care” if an anti-war radio host fought for the Taliban during a 2003 interview.

Sinema ran as a centrist, peeling away enough moderate Republicans from McSally to win by 2 percentage points. In a post-election memo, McSally strategists argued that she did well in a strong Democratic year and noted that the president never polled above 80 percent support among Arizona Republicans. Senate Majority Leader Mitch McConnell lobbied for Ducey to select her.

Still, many Arizona Republicans were disappointed by McSally’s campaign and questioned whether she would be the strongest pick to fill McCain’s seat, especially after she followed Trump’s lead by failing to mention the dying senator’s name during the signing of his last defense bill. That drew public reproaches from McCain’s family.

The most prominent Democrats cited as possible Senate challengers in 2020 are all men, which may give McSally an advantage.