In an unusual twist, Ms. McSally will be paired in the Senate with the woman who just beat her, Kyrsten Sinema. It was Ms. McSally’s performance in that campaign, which she lost by just over two points after struggling to appeal to moderate voters, that gave Mr. Ducey and his advisers pause about appointing her, according to Republicans familiar with their thinking.

But the Senate majority leader, Mitch McConnell, advocated for Ms. McSally, and the governor recognized that she alone had the sort of fund-raising base and statewide name recognition that will be pivotal in 2020, when she will have to run again to serve out Mr. McCain’s unexpired term.

“I look forward to working closely with Kyrsten Sinema in the Senate, as we did in the House,” Ms. McSally said at a news conference with Mr. Ducey, glossing over a fiercely fought campaign in which, at one point, she accused the Democrat of treason.

To receive the appointment, though, Ms. McSally, a Tucson-area lawmaker, was encouraged by the governor to make amends with the McCain family. Ms. McSally, who distanced herself from Mr. McCain during the Republican primary this year, visited the late senator’s widow, Cindy, on Friday in Phoenix.

The meeting went well enough that an individual close to the family said afterward that Mrs. McCain would not oppose the appointment. But on Tuesday she offered more advice for Ms. McSally and praise for Mr. Ducey than she did enthusiasm about his selection.