PHOENIX — Rep. Kyrsten Sinema was once a member of the liberal Green Party and a self-described "Prada socialist," but now she's one of the congressional Democrats most likely to vote with President Donald Trump and a champion of moderate compromise. Though she had token opposition from the left in Tuesday's Arizona primary for the party's nomination for U.S. Senate, Democrats are largely united behind her.

Rep. Martha McSally represents a moderate Arizona district and was a Trump critic in 2016, but she has since warmly embraced him and won her party's Senate nomination. She defeated two challengers from her right in the Republican primary Tuesday, but may emerge with less than half of GOP primary voters supporting her after being slammed as a flip-flopper by opponents.

The Senate race in Arizona is shaping up to be a tale of two pivots - Sinema's transformation over the years against McSally's more abrupt swing on Trump, the most divisive issue in politics today. The different ways the two congresswomen's maneuverings have been received by their parties illustrate how Republicans and Democrats police their own politicians, especially in Arizona, where the GOP has won every statewide election since 2006.

"The Democrats who are unhappy with who she is are willing to put up with that just to win a Senate seat," said Constantine Querard, a GOP strategist renowned for helping conservative Arizona Republicans win primaries. "Republicans are used to winning, so now we want a good one."

McSally and Sinema will face off for the Senate seat being vacated by Republican Jeff Flake, who's stepping down after his criticisms of Trump made his re-election impossible. And their race begins in the shadow of the death of John McCain, the state's senior senator whose refusal to follow GOP orthodoxy helped fuel the Republican base's demands for purity.

Not only have potential voters responded differently to their shifts, Sinema and McSally describe them differently as well.

Sinema, who once served in the Arizona Legislature, acknowledges her shift, casting it as part of a decadelong learning process. "What I learned early on, my very first term in the Statehouse is when I was willing to listen to other people, to their ideas and work together, you can get a lot of stuff done," she told reporters at a food bank in Phoenix last week.

McSally bristles at any suggestion that she's changed, noting she only entered politics six years ago -- before that she was an Air Force colonel who had served as the first female combat pilot. "It's a false narrative," McSally said of the idea she's tacked rightward. During a campaign trip to the border last week, McSally noted that she met with Trump in March of 2017, before the Senate seat opened up. "I have been working very closely with him since he's been in office."

Trump on Wednesday endorsed McSally, calling her "an extraordinary woman" in a tweet and saying she "is Strong on Crime, the Border and our under siege 2nd Amendment."

Nonetheless, McSally was relentlessly characterized by the other Republicans in the primary - former Maricopa County Sheriff Joe Arpaio and former state Sen Kelli Ward - as disloyal to Trump. They noted that McSally said Trump's behavior was "not how leaders carry themselves" and called Trump "disgusting" after a tape of him bragging about groping women surfaced in October of 2016.

"She's the biggest flip-flopper in history," Arpaio said of McSally in a recent interview.

Eric Beach, a Ward adviser, said in an interview last week that even if McSally wins she'll still be wounded - especially given conservatives' anger at Flake and McCain for bucking Trump.

"The problem she has is can she turn out that Republican base that feels like they were duped before," Beach said of McSally. "I don't think she's going to have a problem reaching the middle. She's going to have a problem turning out her base."

But McSally has a secret weapon -- Trump himself. He held off on making an endorsement in the primary, though he enthusiastically congratulated McSally on Twitter after her win Tuesday night. McSally has spoken to the president about a post-primary campaign appearance in Arizona. "He can uniquely motivate the base to get that enthusiasm up," McSally said, noting that Democrats are already energized.

Trump, of course, comes with his own baggage. Though he won Arizona by 5 percentage points and isn't unpopular here, he's at best a wild card, Republican pollster Mike Noble said.

"You have to hug Trump because, if not, you lose your base and you're screwed, but in the general you have to pivot and convince your moderates and independents who don't like Trump," Noble said.

So far, Sinema has had the advantage in the race. She's been able to spend millions of dollars on ads introducing herself to voters with no pushback and faced no real competitive primary.

But the dynamic changed last week when McSally released her first attack ad against Sinema. It contrasted the likely Democratic nominee in a pink tutu at a Sept. 11 anti-war protest with McSally's combat service. McSally picked up that theme in her Tuesday night victory speech, spending much of it slamming Sinema as someone "to the left of Hollywood Democrats."

"Everything in this Senate race is going to be different on Aug. 29," predicted Stan Barnes, a veteran GOP lobbyist, noting his party's strong track record in statewide races. "Republicans have a tremendous head start on Democrats in every general election."

Both Sinema and McSally are suspending their campaigns while McCain's body lies in state at Arizona's Capitol and then is flown to Washington on Thursday. Still, all signs nationally point to Democratic enthusiasm in November, and Arizona is no different in that respect. And both presumptive nominees are top-tier campaigners and prodigious fundraisers.

"Dang, this is going to be a race," Noble said.