(Reuters) - Republican U.S. Representative Martha McSally will take over the late John McCain’s U.S. Senate seat in January, two months after losing her bid for Arizona’s other Senate seat, the state’s governor said on Tuesday.

McSally will replace the retiring John Kyl, whom Governor Doug Ducey appointed after McCain died in August following a battle with brain cancer. Kyl, a former senator, committed to serving only through the end of 2018 when he was appointed.

McSally, the first female combat pilot in the U.S. Air Force and a two-term congresswoman, will serve until 2020, when a special election will be held to fill the remaining two years of McCain’s six-year term.

In November, McSally lost a close race for the state’s other Senate seat to Democratic Congresswoman Kyrsten Sinema.

The appointment means the two former opponents, who waged an intense and expensive battle that saw McSally accuse Sinema of “treason” at one point, will continue to serve alongside each other in Washington.

“Over the last year, I have traveled over this great state, and I’ve met with countless Arizonans,” McSally said at a news conference on Tuesday. “I’ve done a lot of listening, and I’ve learned a lot ... I also look forward to working with Kyrsten Sinema in the Senate, just as we did in the House.”

Asked about criticism that McSally lost the election but will nevertheless join the Senate, Ducey noted she received more than 1 million votes.

Slideshow ( 2 images )

“I believe that the voters had two excellent choices in this past election,” he said.

Sinema’s victory - she is the first Democrat to be elected U.S. Senator in Arizona in 30 years - ensures the state will be a top target for Democrats in the 2020 Senate and presidential contests. U.S. President Donald Trump, a Republican, carried Arizona by four percentage points in 2016.

McSally built a reputation as a moderate in the U.S. House of Representatives but tacked right during her Senate campaign, embracing Trump and adopting a hardline immigration stance.

Arizona, which had never had a female senator before 2018, will be one of six states in 2019 that have two women serving as senators.

McCain, who died at 81 on Aug. 25, was first elected to the Senate in 1987. He was the Republican nominee for president in 2008, when he lost to Democrat Barack Obama.

McCain’s widow, Cindy McCain, said on Twitter that she hoped McSally would follow her husband’s example of “selfless leadership.”