Gov. Jeff Colyer nearly slipped the political shackles he carried into office by transforming himself into an antagonist capable of swiping the GOP nomination for governor from a seasoned rival with a national brand.

Surfacing from obscurity and affixed to his despised predecessor, Colyer’s campaign ventured to polish his prowess and carve enough approval from conservatives in the Republican party to afford the defection of moderates.

Seven months and one pivotal tweet later, he fell 361 votes shy of defeating Secretary of State Kris Kobach in the primary election.

“If I’m being honest,” said Kendall Marr, the governor’s spokesman, “in the beginning, I thought we’d come within nine points if we worked our asses off.”

The fisticuffs of a spirited campaign stewed into the whiplash drama of the past two weeks — in which Colyer exchanged terse letters with his adversary and calculated a legal scrum before conceding defeat and furnishing a full endorsement.

In a race so close, everything mattered.

“Colyer almost winning is maybe a minor miracle in itself,” said Bob Beatty, a political science professor at Washburn University. “He had a few months to accomplish the impossible.”

In the shadows

Marr enlisted in Colyer’s battalion in mid-September, then spent the next four months waiting for Sam Brownback to get out of the way.

The former governor’s name had become noxious in Kansas — where his tax policy wrought perpetual budget problems that undermined services throughout state government — long before President Donald Trump appointed him to an ambassador post in July 2017. Brownback’s departure from the governor’s office was prolonged for six months while awaiting U.S. Senate confirmation, leaving Colyer in limbo.

Colyer, who for seven years dutifully embraced Brownback policy, tried to distinguish himself with a different leadership style.

“I thought (Colyer) did a fantastic job of stepping in and listening to people and really hearing and understanding what their concerns were, and really trying to be very responsive,” said Gina Meier-Hummel, whom Colyer selected to reconstruct the troubled Department for Children and Families.

Colyer revealed Meier-Hummel would take over DCF operations in November, signaling a clear departure from the Brownback regime. But Brownback, resentful of questions about why he hadn’t stepped down, issued a competing news release taking credit for the appointment.

Brownback also delivered the state of the state speech and its accompanying budget recommendations at the start of the legislative session in January, depriving Colyer of his coming out party. Marr said Brownback prepared his own speech, but “the vast majority of the budget” was prepared by Colyer.

In some ways, Beatty said, Colyer was in a political straight-jacket. Aside from his willingness to comply with a Kansas Supreme Court mandate to fund public schools, there was little difference between Colyer and Brownback, or even Colyer and Kobach.

“The big gameday decision when Brownback leaves is, ‘How do I come out of the shadow?’ ” Beatty said. “He chose to do it on style and not policy, and that path made it really difficult for moderates to want to vote for him.”

Like Brownback, Colyer refused to support Medicaid expansion, leaving himself vulnerable on the campaign trail to a malcontent former legislator.

Wait, then strike

After taking office in late January, Colyer’s first TV ad asked: Do you know who the new Kansas governor is?

Before he could take aim at Kobach, Marr said, Colyer needed to establish his own identity. In April, polling from Fort Hays State University showed only half the state’s residents recognized their governor’s name.

As Kobach suffered an embarrassing performance at a federal court trial over his voter registration restrictions, Colyer evaded questions about his opponent’s flaws. Marr staged an ongoing series of news conferences in which the governor announced task forces, executive orders and minor policy adjustments.

“It’s tough,” Marr said. “You’re still trying to build positive name recognition for your candidate.”

Patrick Miller, a political scientist who teaches at the University of Kansas, said the strategy makes sense. Candidates often start with biographical commercials before they talk about issues.

At a debate in late June in Salina, Colyer seemed to catch Kobach by surprise with relentless criticism of his abortion record, failures in court and showmanship.

“He finally drank some coffee one day and decided to attack the guy,” Miller said.

For the next six weeks, the governor continued to swing, but he didn’t always land his punches.

From the beginning, Colyer sometimes struggled with public engagements or questions from media. Marr said he scripted some zingers that didn’t come out as planned in the heat of the moment.

Miller said Colyer could have feasted on low-hanging fruit, framing Kobach as a poor manager who is always surrounded by controversy, sanctioned by courts and less likely to win a general election.

Kobach, Miller said, is “the guy who was basically Donald Trump before Donald Trump came along.”

Instead, Colyer kept returning to a vote Kobach made as an Overland Park councilman to raise an excise fee. In their final debate, Kobach mocked him with a lengthy, patronizing explanation.

“Come on,” Beatty said. “This is a guy who’s now nationally known, flying with Trump, meeting in Trump Tower. And you’re going to convince a voter, ‘Well, I was going to vote for Kobach, but that darn Overland Park vote.’ So that shows someone who’s not comfortable with getting the knife and saying here’s why you shouldn’t vote for Kris Kobach.”

While Kobach rebuffed Colyer’s jabs, the governor suffered blows from another combatant who harbored animosity for the Brownback administration.

Another option

Jim Barnett has no regrets.

Marr wondered why the former state senator — who won the Republican nomination for governor in 2006 and lost to incumbent Gov. Kathleen Sebelius by a wide margin — bothered to stay in a race he knew he couldn’t win.

Barnett rejects the premise that he handed Kobach the election by taking 10 percent of the vote from Republicans who may have been more likely to support Colyer.

“Anybody but Kobach was not good enough for Kansas,” Barnett said. “Colyer was the same as Brownback. Electing Brownback again was not good enough for Kansas. I gave voters a choice.”

As a fellow physician, Barnett hammered the governor for being the architect of KanCare, the privatized, state-run Medicaid system. Barnett was an outspoken proponent for expanding coverage to an additional 150,000 low-income and disabled Kansans.

Colyer’s campaign tried to entice him to leave the race, but Barnett said there was nothing they could have offered. He refused to be part of the administration.

“So if Barnett was a ‘no way,‘” Beatty said, “then it brings us back to the idea that Colyer was in a near impossible situation, based on his seven year loyalty to Brownback, a ‘reap what you sow’ deal. His seven years with Brownback were a killer in that moderates hated him and Brownback so much that 10 percent — a massive amount given the final tally — were definitely not willing to forgive and forget.”

Miller said Barnett didn’t get into the race to hand the election to Kobach, “but that’s what happened.”

“If a few hundred had held their noses and voted for Colyer instead, they wouldn’t be stuck with the mess they’re in,” Miller said.

Turnout in the GOP primary was 39.4 percent, a conspicuous drop from the 42 percent who showed up in 2010, when Brownback was the clear front-runner for an open seat.

‘A different place’

To Marr, it felt like a mid-major college basketball team that hits all its shots but ends up losing to the juggernaut in the closing seconds of the game.

“We knew we never should have been in this position,” Marr said. “When we look at all the odds that were stacked against Dr. Colyer, it’s beyond remarkable the vote count was so close.”

In the final weeks of the campaign, the governor embarked on a tour of all 105 counties of the state. In stark contrast from his early encounters with discontent constituents, Colyer had learned to engage and disarm.

“There were a few times recently we just sat there and thought, ‘Is this the same guy we started the campaign with?’ ” Marr said.

Advance ballots indicate the hard work paid off, giving Colyer a decisive margin. Then, the inevitable happened.

For months, Colyer’s staff dreaded the consequence of a presidential endorsement. The governor frequently praised Trump, remained largely quiet about the trade war’s crippling effects on the state’s agriculture sector and offered support for the president’s immigration policy amid reports that children who were forcibly separated from their parents were housed in Topeka. He signed a letter recommending Trump for the Nobel Peace Prize.

A day before the election, Trump endorsed his close comrade, giving Kobach the boost he needed. Kobach said Trump also provided a robocall that reached thousands of Kansans on the morning of Election Day.

“I know for certain President Trump’s endorsement had a very large impact,” Kobach said.

Separated by 191 votes, a recount seemed inevitable. A clerical error narrowed the distance to less than 100, but as counties tallied provisional ballots, Kobach pulled away.

A week after the election, Colyer abandoned his intent to challenge the outcome of the race and gave his full support to the GOP nominee. At a unity rally Thursday at Republican headquarters in Topeka, Colyer reflected on how the experience changed his life.

“I learned how to bring people together,” Colyer said. “I think Kansans see very clearly we’re in a different place than we were six months or a year ago. And I’m glad to be a part of that.”