Virginia Gov. Bob McDonnell speaks to the press in front of a statue of George Washington at the Capitol on Feb. 5 in Richmond. (Steve Helber/Associated Press)

Robert F. McDonnell had just done something huge, something that for nearly a generation, every other Virginia governor had tried and failed to do. As leader of a state with some of the nation’s worst traffic and a road construction fund due to go broke by 2017, he’d ordered legislators to find a fix.

At the very moment they complied, as the balky Senate voted to send a transportation funding bill to the Republican governor, somebody watching the proceedings from inside McDonnell’s third-floor Capitol office snapped a photo that soon wound up on Twitter.

McDonnell, hands covering his mouth, palms and fingertips together as if in prayer, looks overcome with emotion. An applauding aide, tie aflutter and knees bent, appears to be doing a celebratory hop.

McDonnell looks very happy. And that’s a problem, at least now, as conservatives criticize the deal, which is heavy on taxes and came only after Democrats exacted a written pledge from the governor on Medicaid expansion. In supporting the deal, McDonnell broke a major campaign promise — made in 2009 while eviscerating Democrat R. Creigh Deeds for his willingness to raise taxes for transportation.

At times, McDonnell seems loath to admit it, offering contorted scenarios by which the $1.4 billion-a-year plan, which raises and rejiggers a byzantine mix of statewide and regional taxes and fees, could be considered “revenue neutral.”

“If you live in Hampton Roads and Northern Virginia, you’re going to be paying more. No way to sugar coat that,” McDonnell said, referring to areas where regional taxes will be imposed. “If you’re in another region of the state, and you don’t drive a hybrid, you don’t drive a diesel truck, in your first year, you’re going to have about a revenue-neutral tax reform.”

A cautious politician, the term-limited governor has stepped out in his final year to back a compromise that could burnish his legacy with everyone but his conservative base. Just last year, McDonnell was in the mix as a GOP vice presidential contender. Now, as he is said to mull a presidential run in 2016 or perhaps a bid for U.S. Senate, observers say he will either have to repair his relationship with the right or repackage himself as a pragmatic centrist — wrestling with the same identity crisis that afflicts the Republican Party as a whole.

McDonnell has tried to frame the transportation package as the ideal bipartisan compromise, the perfect counterpoint to all that’s wrong with Washington. Yet he’s also casting the deal in the most conservative light: playing down the tax bite, stressing its advantages for business, job growth and the state’s bond rating, and invoking President Ronald Reagan’s 30-year-old gas tax increase.

“He’s showing some courage. He’s just not owning it in a way a [New Jersey Gov.] Chris Christie would own it,” Democratic consultant Mo Elleithee said.

“Once the dust settles on this and Bob McDonnell begins the next leg of his political journey, that’s the struggle he will have to deal with: Is he this fiscally balanced moderate compromiser? Or is he the fiscally, socially conservative hero that he still wants a lot of people to see him as?” Elleithee said. “He kind of wants people to see him as all of the above, but with this Republican Party, I’m not sure that it’s possible.”

The transportation bill cleared the General Assembly six days before dug-in Washington let budget cuts known as sequestration take effect. McDonnell — who tried selling state-run liquor stores and offshore drilling rights before relenting to a plan with tax increases — said the nation’s capital should come together like Virginia’s.

“It was evenly supported by Republicans and Democrats, I think 44 Republicans, 42 Democrats supported the bill,” McDonnell said on WTOP (103.5 FM) a few days after the vote.

Those numbers suggest more bipartisan bliss than was the case, considering that Republicans far outnumber Democrats in Richmond. Half of McDonnell’s 88-member caucus was with him.

Republicans who weren’t on board said they think the governor gave up more than he got. His original $845 million-a-year proposal raised some taxes and fees but nixed the gas tax and purported to be essentially “revenue neutral” because the big money rolled in only when and if the economy expanded.

By the time the General Assembly had its way, it was an $880 million-a-year package with an additional $550 million in regional tax increases. The few selling points for conservatives — that the gasoline tax, though newly tied to inflation, is cut, and that $200 million a year comes from existing general fund revenue — will evaporate without federal legislation allowing states to collect tax on Internet sales. If Congress does not pass that long-stalled bill by January 2015, the gas tax will rise and the general fund contribution will drop to $60 million a year.

The kicker for Republicans: McDonnell got that deal only after relenting to Democrats’ demand for a written pledge accepting the outlines of an agreement on Medicaid expansion. Democrats intended the Medicaid pact to ease expansion of the health-care program, authorizing a commission to extend it to 400,000 more poor, disabled and elderly Virginians if Washington allows the commonwealth to enact certain reforms. McDonnell’s staff insists there was no link between the two issues, but Republicans and Democrats close to the negotiations say transportation would not have gone forward without McDonnell’s Medicaid letter.

Each party claims to have outfoxed the other with the Medicaid language, which ties any expansion to reforms. In any case, the perception that McDonnell caved on Medicaid to get transportation has galled conservatives.

“Because McDonnell was so desperate for this gigantic tax hike, he was willing to wheel and deal on Obamacare, too,” conservative blogger Erick Erickson wrote on Red State.

But some say McDonnell will come out of this looking like a can-do executive.

“You can make enemies if you do stuff, but you have to do stuff,” said Craig Leonard Brians, a Virginia Tech political scientist. “True leadership is being willing to make people angry and convincing them . . . they have to swallow that bitter pill.”

Lt. Gov. Bill Bolling (R), who backed the transportation plan and Medicaid expansion, has been exploring an independent bid for governor on the premise that Virginians are yearning for middle-of-the-road solutions rather than ideological purity.

“I like the governor, and I think he’s actually a kind of crossover conservative in a lot of ways,” said Terry Holt, who helped manage President George W. Bush’s campaigns in 2000 and 2004. “He’s actually governing and acting as an executive, and I think that will play well on a national stage.”

When his name came up as a potential vice presidential pick last year, McDonnell billed himself as someone who reached across the aisle to solve problems. Yet until now, the governor has been more about the genteel “Virginia way” than a centrist “third way” — largely sticking by his conservative principles.

“A week ago, the governor faced a fork in the road: One [way] was not to compromise and not get anything, and the other was to fix a major problem in the state and have a legacy,” said Stephen Farnsworth, a University of Mary Washington political scientist.

Such a move could play well in a statewide race — for U.S. Senate, perhaps, or governor again in four years — because even the most tax-averse Virginians are familiar with the state’s epic traffic woes, some observers say. Whether it would fly in Iowa is another matter.

“ ‘We’re not like Washington: ‘We raise taxes’ is not really a Republican bumper sticker,” grumbled one Richmond Republican frustrated with the deal.

Although he seems unlikely to embrace the “radical centrist” styling of Sen. Mark R. Warner (D-Va.), McDonnell could find himself in a position similar to the popular former governor’s, whose business background alienates him from some elements of his own party, said Bob Holsworth, a longtime Richmond political observer.

“He may look much like Mark Warner in Virginia, very popular but somewhat at odds with his own party base for national viability,” Holsworth said. “The question is: Does he become persona non grata as [anti-tax activist] Grover Norquist would like him to become? Or is he sort of an early indication that the Republican Party is shifting on this?”

A Facebook page devoted to the issue, Stop Largest Tax Increase in Virginia History, has assembled a host of embarrassing hits on the governor, including a picture of McDonnell as a cape-wearing superhero tax man “able to leap big promises on taxes in a single bound.”

At the very top is that image of the emotional-looking governor, snapped the moment the bill passed. The shot was tweeted by Randy Marcus, Bolling’s chief of staff, apparently as good-natured ribbing of the giddiest-looking guy in the picture, McDonnell spokesman Tucker Martin. Martin later said he was not jumping for joy but merely getting off the desktop where he’d been perched.

Marcus later deleted the tweet, but not before conservative blog Bearing Drift not only saved the image, but also made it the subject of a caption contest.

“Oh, Oh, Oh, I really did it!” read one entry. “I . . . put a stake through my political future!”