PHOENIX — Retired astronaut Mark Kelly, who became a prominent gun-control advocate after his wife, former U.S. Rep. Gabrielle Giffords, was shot in a failed assassination attempt, announced Tuesday he will run to finish John McCain’s last term in the U.S. Senate.

Kelly, 54, is a top Democratic recruit to take on Republican Martha McSally in one of the most closely contested Senate races of the 2020 election.

McSally is a former Republican congresswoman who was appointed to McCain’s seat last year after she narrowly lost to Democrat Kyrsten Sinema. McSally leaned heavily on her record as the first woman to fly a combat mission as a fighter pilot, but she was hurt by her embrace of President Donald Trump.

If Kelly is nominated, the race would pit a Navy veteran and astronaut against a trailblazing Air Force pilot in the contest to replace McCain, a legendary Navy flyer who was famously shot down and held captive.

The 2020 election will decide who finishes the last two years of McCain’s term. The winner would have to run again for a full six-year term in 2022.

Democrats are eagerly watching the Arizona contest, having already defeated McSally in a Senate race just a few months ago. The party is also gauging whether Arizona could be competitive at the presidential level in 2020.

Kelly has never held elected office. A retired Navy captain, he flew combat missions from an aircraft carrier during the first Gulf War before becoming an astronaut along with his twin brother, Scott Kelly. He flew four space missions between 2001 and 2011.

Kelly and Giffords have for years pushed Congress to enact gun control measures with little success. They shifted their focus to state legislatures in recent years, helping to strengthen background checks and domestic violence protections, among other modest protections.

Giffords was severely wounded in a mass shooting on Jan. 8, 2011. The shooting at a Giffords meet-and-greet event outside a grocery store in Tucson left six dead and 13 injured. Shooter Jared Loughner was sentenced to life in prison.

Gov. Doug Ducey, a Republican, appointed McSally to the vacant Senate seat after his first appointee, former Sen. Jon Kyl, resigned after only a few months in office.

The seat is a top target for Democrats because McSally just lost a Senate race in November and Democrats posted a strong showing in the November election, winning three statewide contests and picking up legislative and congressional seats. Arizona has been a longstanding Republican stronghold, but a growing Latino population and frustration among women with Trump have helped Democrats make inroads.

U.S. Rep. Ruben Gallego of Phoenix is also considering a Senate run, which would likely set up a tough fight for the Democratic nomination.

Former Arizona Attorney General Grant Woods, a lifelong Republican who became a Democrat and a fierce critic of Trump, announced last week that he will not run, saying he did not want to fight in a contested Democratic primary.

McCain, a legendary and beloved Arizona politician, died last year from an aggressive form of brain cancer after more than three decades in the Senate.