By NICHOLAS RICCARDI, Associated Press

In a year of liberal challenges to President Donald Trump, an avowed centrist scored the Democratic Party's biggest coup -- flipping a red state's U.S. Senate seat.

Rep. Kyrsten Sinema won the Arizona Senate seat being vacated by Republican Jeff Flake to become the first woman to win a U.S. Senate seat in the state. The race against Republican Rep. Martha McSally was tight enough that a winner wasn't decided until Monday, after a slow count of mail-in ballots gave her an insurmountable lead.

Sinema's win achieves a longtime Democratic goal of making Arizona, with its growing Latino population, a competitive state. And she did it by pointedly not running against the president, or even critiquing his hardline immigration stance.

"She didn't put the progressive bit in her mouth and run with it," said Chuck Coughlin, a GOP strategist in Phoenix. "She spit it out and did something else."

Sinema targeted moderate Republican and independent women by painting herself as a nonpartisan problem-solver who voted to support Trump's agenda 60 percent of the time. Her nearly single-issue campaign talked about the importance of health care and protections for people with pre-existing conditions.

She knew McSally was vulnerable there because she backed the Republicans' failed attempt to repeal President Barack Obama's health care law.

Sinema tailored her campaign for conservative-leaning Arizona rather than the national environment, but it may be a guide for Democrats who hope to expand the electoral map in 2020. While some liberals won important races in California, Colorado and Kansas, the left's highest-profile champions disappointed on Election Day.

Rep. Beto O'Rourke fell short in his challenge to Sen. Ted Cruz in Texas. Stacey Abrams trails her Republican opponent in the still undecided bitter Georgia gubernatorial race, and Tallahassee Mayor Andrew Gillum, who once led in the polls in the race for Florida governor, is now awaiting the results of a recount.

Sinema prevailed while the Democratic candidate for governor, David Garcia, ran as an avowed progressive and got trounced by Republican incumbent Doug Ducey.

"Kyrsten was the perfect candidate for this race," said Democratic strategist Chad Campbell, who previously served with Sinema in Arizona's state legislature. "We saw that with Garcia."

Sinema first came to prominence as an openly bisexual Green Party activist in Phoenix, and McSally raked the Democrat over her protests against the Iraq and Afghanistan wars. Sinema was elected as a Democrat to the state legislature in 2004 and carved out a reputation as a liberal who could work with her conservative colleagues.

By the time she was elected to Congress representing a suburban Phoenix swing district in 2012, Sinema had completely remade herself into a centrist. She voted against Nancy Pelosi as the Democratic leader, supported relaxed regulations on banks and a law to increase penalties on people illegally re-entering the country. She supported a bill making it easier to deport immigrants identified by police as gang members.

During the Senate campaign, Sinema stuck to her centrist message, almost robotically at times. She faced only a nominal primary challenge from her left and was free to burnish her nonpartisan credentials, unlike McSally, who faced two primary challengers from the right and tied herself to Trump.

On Election Day, Sinema swung by Arizona State University's downtown Phoenix campus to hand out doughnuts and gleefully posed for photos. She has four degrees from the school and teaches two classes there.

"What are you going to do for people who are a little more on the left?" voter Petra Morrison asked. The candidate said she wasn't focused on party labels or ideology. Morrison later told a reporter she was going to vote for Sinema, even though "she seems to come across as a Democrat in sheep's clothing."

Though Sinema wooed moderates, she needed liberals like Morrison in her corner for her win. She benefited from a longtime organizing push by activists who especially targeted the state's young, growing and Democratic-leaning Latino electorate. "It's been 10 years and even more, this mobilization and galvanizing," said Lisa Magana, a professor in ASU's School of Transborder Studies.

And though Trump's rhetoric on immigration seemed pitched to Arizona voters' anxieties about the border, both Democratic and Republican polls throughout the race showed the president had more people disapproving of him.

Trump visited only once on McSally's behalf in mid-October. The following week, Democratic Rep. Ruben Gallego said there was a notable spike in Latinos returning their early ballots; most Arizona residents vote by mail.

"It was like they spent the weekend at the kitchen table" filling out the ballots in anger, Gallego said.

Annette Villelas was one of those angry voters. She registered for the first time so she could vote for Democrats and against Trump. It wasn't just the way the president deals with immigrants, she said after shaking Sinema's hand at a Phoenix taco shop.

"The way he talks just to the public, it's not right," Villelas said. "I want to vote and get him out and get someone in for the people."

Ron Horsford, a 50-year-old Republican, was at the same event and said he was excited to vote for Sinema. He liked her message of "I'm going to work with the other side."

The question for Democrats in Arizona is whether they can attract voters like Horsford and Villelas in 2020. Not only does the party hope it can put the state in play in the presidential race, voters will get to choose the John McCain's permanent successor. Republican Sen. Jon Kyl, who was appointed after McCain's death, has pledged not to run.

Despite its image as a staunch Republican bastion, Arizona is attracting younger, educated voters from elsewhere in the United States. In this election, Democrats expanded their share in the state Legislature, though they're still the minority. They took a 5-4 majority in the state's congressional seats and remain competitive in two down-ballot and uncalled statewide races.