Martha McSally just lost the Arizona Senate race. She could still be a senator next year.

It’s an interesting twist for the highly contested race.

Republican Martha McSally has officially lost the Arizona Senate race to Democrat Kyrsten Sinema. But interestingly enough, she could still wind up in the Senate next year.

Due to a striking twist of timing, it’s conceivable that both McSally and Sinema could represent Arizona in the upper chamber in 2019.

It’s a scenario made possible by current Arizona Sen. Jon Kyl — who was appointed earlier this summer to fulfill a portion of the late Sen. John McCain’s last term. While the next election for this seat won’t be held until 2020, Kyl has said that he only intends to serve until January 2019 — at which point, Arizona Gov. Doug Ducey will have to appoint someone new to tide the state over until the following year.

State law requires that Ducey appoint someone of the same party as McCain and Kyl, which means he’ll have to pick a Republican — and McSally could very well be in the running.

McSally might not be Ducey’s pick of choice

There’s certainly precedent for previous Senate candidates getting appointed to seats after they’ve been defeated, though the rapid-fire timing on this is uncommon. Wyoming Sen. John Barrasso lost his Republican Senate primary in 1996, for example, and was appointed to take on a Senate seat in 2007 after Sen. Craig Thomas died.

The ultimate closeness of the race — which had the two candidates separated by 1.7 percentage points when it was called — could play in McSally’s favor, says University of Arizona professor Lisa Sanchez. This margin is close enough to mean that “she would not be an unpopular choice for nearly half of Arizona voters,” she says.

What remains unclear, however, is whether McSally ranks that highly on Ducey’s list.

“I certainly think that McSally is in the mix of possible candidates to replace Kyl, but she is not the only candidate,” says Cook Political Report’s Jennifer Duffy. “Ducey has to please a lot of constituencies with this pick, especially since whoever gets the appointment has to run in 2020 and 2022.”

Another political expert offered an even more definitive take, noting that two Arizona sources had said that McSally was, in fact, out of the running already. “For a long time, I thought McSally replacing Kyl was a good bet, assuming McSally lost to Sinema,” the expert said. “Recently, two of my solid AZ contacts have told me it is not going to happen. … I tried to find out why and, if this is true, why McSally was not going to be the choice. Radio silence.”

While much of this is still pure speculation, there are several possible reasons Ducey could go with someone other than McSally — ranging from stigma over appointing a recent electoral “loser” to a key seat to questions over whom the broader Arizona Republican Party would like to potentially support. McSally has faced fierce challenges from the right in the past, not to mention alienated some when she distanced herself from McCain during the election.

Another big X-factor here is President Trump. Though Arizona Republicans like to style themselves as independent of him, it’s possible that the president weighing in strongly on Kyl’s replacement, one way or another, could sway things.

Any of these issues could potentially put McSally at a disadvantage for Kyl’s seat — though it’s still a little early to tell whether this would be the case. McSally’s campaign did not immediately respond to a request for comment.

Sinema ultimately edged McSally out by over 38,000 votes as of the last count on Monday.