Sen. John McCain (R-AZ) died on Saturday at age 81, a year after he was diagnosed with brain cancer.

The former Navy pilot, Vietnam prisoner of war, Republican presidential nominee, and 30-year US senator leaves behind a complicated legacy. He served his country with distinction and at times proved willing to defy partisanship in service of his own principles. Other times, he fell short of his own ideals and the “maverick” reputation bestowed on him in the popular imagination.

As the world takes stock of his life and legacy, McCain’s death also has dramatic consequences for the chamber he devoted three decades of his life to. In the near term, Arizona Gov. Doug Ducey will appoint a replacement who will likely be a more conventional Republican, one less likely to buck their party’s leadership, which could make it easier to wrangle together the 51 Republican senators needed for tough votes.

But McCain’s Senate seat will not be on the ballot in Arizona in 2018. Under Arizona law, the deadline has passed. Ducey’s replacement will serve until 2020 in a state that has been trending blue and where Hillary Clinton lost to Donald Trump by less than 4 points in 2016.

John McCain’s legislative career, in brief

McCain had a remarkable life and a complex career. He earned his maverick reputation by subverting Republican ideology on a number of high-profile issues. McCain, who arrived in the House of Representatives in 1982 after a long naval career, opposed the Reagan administration’s decision to send troops to Lebanon in 1982. He entered the Senate in 1986 and expanded on said reputation there.

While he ran for the GOP presidential nod in 2000 against George W. Bush, he opposed tax cuts for the rich. He supported a path to citizenship for undocumented immigrants. And he was one of the few climate hawks (at least compared to his peers) in the Republican caucus.

In 2002, he helped steer through a bipartisan campaign finance reform bill with Sen. Russ Feingold, which sought to cap so-called “soft money” in political campaigns. It has been more or less superseded by the Supreme Court’s Citizen United decision. But it is indicative of the senator McCain often tried to be.

But he sometimes fell short of this party-bucking ideal. While he courted the image of a “maverick,” he often fell in line with the Republican Party. He had an 82 percent rating from the American Conservative Union. FiveThirtyEight found he voted with President Donald Trump more than 80 percent of the time last year despite refusing to endorse him for president.

Last year typified McCain’s duality. In the summer, he took a dramatic stand against Republican leaders by theatrically turning his thumb down during a critical vote that stopped Obamacare repeal, the GOP’s top legislative priority at the time, dead in its tracks. But a few months later, though it contradicted many of his previous statements on tax cuts for the rich and the legislative process, McCain supported the Republican tax bill with little apprehension.

What changes in the Senate for now

Even so, McCain was a less reliable Republican vote than many of his colleagues. The most immediate impact in the Senate after his death, therefore, is who fills his seat for the next year. Given that Republicans have only a 51-seat majority after Doug Jones’s win in Alabama, every vote counts.

Gov. Ducey’s appointed replacement will occupy McCain’s seat until 2020. One possible contender was Republican Rep. Martha McSally, but she is already running for the Senate this year. The other is Dr. Kelli Ward, also running for that seat.

Whoever it is, the new Arizona senator seems likely to be a more reliable vote for Republican leaders than McCain was. Ducey is more or less a traditional Republican himself. He will likely choose somebody his party’s leaders would approve of.

That could smooth the road for Republican leaders on some issues as they try to navigate the 51-49 Senate and get judicial and Cabinet nominees approved, pass other legislation, etc.

However, on the big-ticket items — namely, Obamacare repeal or welfare reform — McCain’s replacement might not make much difference.

The problem for reviving health care, for example, is that a Democrat now occupies the formerly Republican-held seat in Alabama and Sens. Susan Collins (R-ME) and Lisa Murkowski (R-AK), who have opposed every repeal plan so far, don’t sound like they want to revisit the issue. Those three alone — plus Sen. Rand Paul (R-KY), who opposed the latest iteration of repeal, known as Graham-Cassidy — form an imposing wall for Republican leaders to overcome no matter who fills McCain’s seat.

So on smaller items and appointments, the new Arizona senator could make things a little easier for GOP leaders. But getting any major legislation through a 51-49 Senate in an election year is still going to be tough.

The Democratic opportunity in Arizona

Whoever Ducey appoints to take McCain’s seat will face the voters again in 2020. That represents a significant opportunity for Democrats then.

For now, they still have a significant shot at Flake’s seat, one of their few opportunities to win a seat currently held by Republicans, with Democrat Kyrsten Sinema consistently polling in the lead ahead of every one of her Republican competitors.

Vox’s Andrew Prokop walked through the 2018 Senate map at length. The shorter version: Democrats have a map disadvantage. They are defending 26 seats in the next election, while Republicans have only eight seats to hold. Democrats are up in states that Trump won in 2016, like Ohio, Michigan, Indiana, and West Virginia.

But Democrats are buoyed by a devastatingly unpopular Republican agenda and Trump’s historically low approval ratings. They saw their chances of retaking the Senate blossom after Doug Jones unexpectedly won in Alabama, which narrowed the Republican majority from 52-48 to 51-49.

Democrats have a two-step path to winning the Senate and providing a substantial roadblock for the last two years of Trump’s first term. First, they have to hold their seats in those tough states like West Virginia and North Dakota. Then they have to win two Republican-held seats.

The most obvious targets are Nevada, where Sen. Dean Heller is up for reelection and where Clinton won, and Arizona. The latter state has long been a coveted target for Democrats, attracted to its growing Hispanic population. Trump won Arizona in 2016, but by a notably narrow margin: just 3.5 percent.

McCain already made Arizona a state to watch, with his high-profile and interesting career. Now, after his death, the state’s evolving nature ensures its Senate elections will be among the country’s most closely contested for the foreseeable future.