Oklahoma City — Helen Swope considers herself a traditional Republican, skittish about paying higher taxes for what can seem like the ever-growing role of government.

But after Oklahoma City spent hundreds of millions of dollars building new parks, bicycle trails, elite recreational facilities and a soon-to-be-completed streetcar network, Swope thinks maybe the state government can learn something from the city’s former four-term mayor, Mick Cornett, a leading Republican candidate for governor.

“The whole city has been transformed,” said Swope, who lives in the suburbs but now travels into the city each weekend to new indoor tennis courts paid for by city taxpayers. “You get a lot of promises a lot of the time and nothing happens, but now there were a lot of promises and things happened.”

Even as Republican voters nationwide continue to lurch to the right, Swope’s assessment of Cornett reflects a surprising trend in Oklahoma politics this year: The pro-government Republican is making a comeback, as GOP voters at least in some places reject hard-line anti-tax policies.

After years of upheaval in state government, including chronic budget shortfalls and this year’s teacher walkout over low pay, Oklahoma Republicans veered toward moderation when they selected two candidates from the state’s urban centers — Cornett and Tulsa businessman Kevin Stitt — to advance to an Aug. 28 runoff.

The election was a setback for the state’s tea party and Christian conservative movements, as Cornett and Stitt defeated eight other GOP candidates, including Lt. Gov. Todd Lamb, who had sought to align himself with President Trump.

The results were widely interpreted as a repudiation of Gov. Mary Fallin (R), who pushed for income tax cuts even as teachers and advocates decried cuts to state education funding. Fallin is barred from seeking a third term.

Analysts and Oklahoma residents say the outcome also reflected a more fundamental disenchantment with the direction of a state that is becoming more diverse and under the sway of comparatively moderate voters in metropolitan areas.

“I think I have a lot of the same sentiments that a lot of other people in Oklahoma do — our senators, legislators and governor have been so strong fighting against each other, nothing is really getting done,” Ryan Codding, a 42-year-old Republican, said as he and his children were selling 100 bushels of corn last week at a roadside stand in suburban Oklahoma City. “Sometimes you just need change.”

Cornett, the top-vote getter, at just under 30 percent, prevailed even though as mayor he pushed for higher taxes, questioned congressional efforts to hastily overturn the Affordable Care Act, supported a local gay rights ordinance and co-wrote a letter with liberal New York City Mayor Bill de Blasio urging the federal government to spend more money on transportation and public works projects. He also backed state tax increases to pay for teacher pay raises.

Stitt, a political newcomer who founded a large mortgage company, campaigned as a pragmatic conservative and won just less than a quarter of the vote. He secured a spot in the GOP runoff even though the Tulsa World reported he had failed to vote in any gubernatorial election dating back to at least 1999. His support for broad criminal justice restructuring, including freeing some nonviolent offenders from Oklahoma prisons, also didn’t seriously hamper him in the GOP primary.

The two will probably emphasize conservative positions as the runoff nears, since it is expected to draw fewer voters, who lean more conservative, than the June primary, but voters’ attraction to some level of moderation overall seemed clear.

The primary attracted more than 450,000 Republican voters — nearly double the turnout from four years ago — as Oklahoma also decided a state referendum to legalize medical marijuana. It passed with 56 percent of the vote, even though a coalition of religious conservatives and local sheriffs vigorously opposed it.

GOP primary voters also ousted two Tulsa-area state legislators who voted against tax hikes to fund teacher pay raises. Seven other anti-tax GOP legislators were forced into runoffs against more moderate challengers.

The dynamic in Oklahoma echoes ongoing GOP battles in neighboring Kansas, another heavily Republican state where conservatives have faced backlash over their refusal to raise taxes.

In Oklahoma, the growth of the state’s two largest cities, Oklahoma City and Tulsa, have strengthened the moderate hand.

According to an analysis by the nonpartisan Oklahoma Policy Institute, almost half of Oklahoma’s 77 counties have lost population over the past century. The state’s growth is now centered in urban areas, where two-thirds of residents reside.

The population of the Oklahoma City metropolitan area increased 10 percent to 1.3 million residents over the past decade. In areas closest to downtown, well-educated millennials and Hispanics — who now make up more than half of the students in Oklahoma City public schools — are responsible for much of the population growth, according to city officials.

Cornett, who was a popular television sports anchor before being elected mayor in 2004, worked to diversify an economy once heavily dependent on oil and natural gas industries.

In 2009, he campaigned aggressively for a 1-cent increase in the sales tax to fund $771 million in economic development and wellness projects. (He also made headlines for inspiring a citywide diet, in which he claims 47,000 residents lost a combined 1 million pounds.)

The sales tax revenue has paid for a $228 million downtown convention center and nearby 70-acre park, and a seven-mile streetcar system that connects downtown with neighborhoods transformed with new apartments and condominiums.

Another $45 million was spent constructing a man-made white-water rafting and kayaking center along the waterfront, which is billed as the first facility of its kind in the heart of an American city.

That sort of public works spending traditionally hasn’t been associated with Republicans, but in last month’s primary, Cornett racked up big margins throughout the 34-county Oklahoma City television media market, which makes up about half the state’s population.

“Historically, we were dominated by very conservative, rural voters. But now our urban areas are changing, and Mayor Cornett represents that,” said Roy Williams, president of the Oklahoma City Chamber of Commerce. “It’s a much more moderate, and not much of a my-way-or-the-highway approach.”

In a western Oklahoma City neighborhood, 83-year-old Mary Perdue lives a few hundred yards from a new eight-mile bicycle and walking trail that connects several vehicle-centric neighborhoods of single-family homes, strip malls, automobile dealerships and fast-food restaurants.

Although she considers herself to be a committed conservative, Perdue said she is supporting Cornett because “he’s creative” and has a vision that will draw “young people” to the state.

“He has done an excellent job as far as building downtown, and he did what he set out to do,” said Perdue, a retired schoolteacher.

In an interview, Cornett said Oklahoma voters view spending on public education and health care, among other things, as an “investment.”

“You cannot wait for someone from the outside to save your city, and state. You have to do it yourself,” Cornett said.

Stitt hopes to distinguish himself from Cornett by opposing tax increases, which he thinks still resonates with rural voters who could prove decisive in the runoff.

“The typical politicians and guys I am running against, their first move is raising taxes without any kind of reforms or efficiencies,” said Stitt, who easily carried the 20-county Tulsa media market in the primary.

But Bill Shapard, Oklahoma’s preeminent pollster, said recent surveys showed the state’s Republicans have adopted a very nuanced view of taxes. Even though a plurality of Oklahoma Republicans said taxes are too high, nearly two-thirds of them supported tax increases to pay teachers, Shapard said.

Oklahoma Democratic leaders appear to be rooting for Stitt, believing Cornett’s base in Oklahoma City would put the Democratic nominee, former attorney general Drew Edmondson, at a disadvantage in November. Many GOP strategists think Edmondson, who repeatedly challenged the tobacco industry and other corporations when he was attorney general, will make the general election highly competitive.

At Oklahoma City’s botanical garden, Michael Dotson, 66, and his wife, Victoria, 65, said they remain undecided in the GOP runoff. The Republican couple also isn’t ruling out voting for Edmondson in November.

After retiring, the couple recently sold their house in the suburbs and moved into a condominium in downtown Oklahoma City. Although they are no fans of taxes, what they want most of all, they said, is a government that works.

“We are just weary of doing nothing in our state,” said Michael Dotson. “And we think we have the possibility of doing incredible things.”