WASHINGTON — With the help of three Colorado Republicans, the U.S. House on Thursday passed a long-promised health care bill that would undo major pieces of the Affordable Care Act.

But U.S. Rep. Mike Coffman, R-Aurora, wasn’t one of them.

Hours before the vote, the fifth-term lawmaker said he had decided to oppose the measure because Republican leaders did not include an amendment that would limit the amount that insurance companies could charge patients with pre-existing medical conditions.

The decision was — in a word — controversial.

For years, Coffman has run on the pledge that he would join his Republican colleagues in repealing and replacing the Affordable Care Act, also known as Obamacare. As recently as six weeks ago, Coffman was the only House Republican from Colorado to publicly support a similar plan that fell apart hours before a scheduled vote.

But Coffman said he couldn’t back the latest version after GOP leaders amended the bill to placate hard-line members of his party.

His choice made a razor-thin vote even closer.

Coffman was one of just 20 Republicans who opposed the bill; the rest of Colorado’s delegation voted along party lines in the nail-biting 217-213 tally.

The move triggered the equivalent of a political Rorschach test back in Colorado as operatives across the ideological spectrum speculated on the motivation of Coffman’s last-minute decision.

But Coffman said it all came down to his desire to preserve protections for patients with pre-existing conditions; a hallmark of the health care law that he has vowed for years to dismantle.

“I was really desperate to get this amendment,” Coffman said.

He said he told Republican leaders, from President Donald Trump to House Speaker Paul Ryan, that he wanted to change the bill and put a cap on the amount of money that insurance companies could charge patients who lose insurance coverage and then try to get it again.

The idea was to prevent consumers with pre-existing conditions from facing sky-high rates.

“It was important to have a uniform rule,” Coffman said.

He said he raised that point in a meeting with Ryan as well as during phone calls with Trump and Vice President Mike Pence.

“The last 72 hours — let me tell you — were tough,” Coffman said.

A half-hour before the vote, both Trump and Pence tried to get him to change his mind

It didn’t work.

But ultimately they didn’t need Coffman — a result that led some Colorado liberals to speculate that Republican leaders gave him a pass to oppose the bill.

“Coffman supported Trumpcare before he opposed it, and his voting ‘no’ on the latest version is because of the people in Colorado who made their voices heard over the past weeks, especially today,” Ian Silverii, the executive director of ProgressNow Colorado, said in a statement.

After the vote, dozens of House Republicans went to the White House to celebrate the vote in a Rose Garden affair. A Coffman aide said the Colorado lawmaker did not join them.

During an interview in his Washington office, Coffman didn’t limit his criticism to how the measure treats patients with pre-existing conditions.

He also knocked GOP leaders for advancing the proposal without getting a score from congressional budget crunchers on how much it would cost; a concern also raised by Democratic opponents.

“I think this is a big, big, big price tag,” he said. “We should not have voted without a (Congressional Budget Office) score.”

Earlier in the day, U.S. Rep. Diana DeGette, D-Denver, made a similar point on the House floor. “My Republican colleagues are going to be really, really sorry that they rushed this bill to the floor before they got an amended CBO score,” DeGette said.

But Coffman said Ryan and other officials were motivated by a desire to simply get it done.

“Get it out of here. Get it over to the Senate,” Coffman said. “The fact is that you cannot do tax reform until you get this off the table.”

Coffman, however, wasn’t the only Colorado Republican with reservations. U.S. Reps. Doug Lamborn and Scott Tipton were on the fence until Wednesday — though the two lawmakers ultimately joined Rep. Ken Buck in supporting the repeal bill.

“With this vote, we have ended the individual mandate, blocked federal funding from going to Planned Parenthood and other abortion providers, phased out Medicaid expansion, reduced regulations and taxes, and gutted Obamacare,” Lamborn said in a statement.

All three House Democrats from Colorado were opposed: DeGette, Ed Perlmutter and Jared Polis.

“By all accounts, Coloradans will suffer if this bill becomes law. This plan takes us backward and is a bad deal for millions of hardworking families who have come to rely on affordable, quality health insurance,” Perlmutter said in a statement.

With the bill’s passage, attention now shifts to the Senate and another Colorado Republican — U.S. Sen. Cory Gardner.

Like Coffman, Gardner has vowed to undo the Affordable Care Act. But Gardner also has taken issue with the speed in which some Republicans want to scuttle a key piece of the Affordable Care Act that expanded Medicaid insurance to millions of Americans.

About 407,000 state residents were added to the Medicaid rolls through that provision, which has been the driving force behind a sharp drop in the number of Coloradans without health insurance — from nearly 15.8 percent in 2011 to 6.7 percent in 2015, according to the Colorado Health Institute.

Said Gardner on Thursday in a statement: “I look forward to working with my colleagues to complete a measure that leads to more choices, lower costs, and improved care for all Coloradans.”