BOSTON — He came into office with a mandate to shake things up, an agenda laden with civics-book reforms and a raging fiscal crisis that threatened to torpedo both. He sparred with a hostile legislature and suffered a humiliating setback in the midterm elections. As four years drew to a close, his legacy was blotted by anemic job growth, sagging political popularity and — except for a landmark health care overhaul bill — a record of accomplishment that disappointed many.

That could be the Barack Obama that Mitt Romney depicted in Wednesday’s presidential debate as an ineffective and overly partisan leader. But it could also be Mitt Romney, who boasted of a stellar record as Massachusetts governor, running a state dominated by the political opposition.

Mr. Romney did score some successes beyond his health care legislation, notably joining a Democratic legislature to cut a deficit-ridden budget by $1.6 billion and revamping a troubled school building fund. Some outside experts and former aides say his administration excelled at the sorts of nuts-and-bolts efficiencies that make bureaucracies run better, like streamlining permit approvals and modernizing jobs programs.

As a Republican governor whose legislature was 87 percent Democratic, Mr. Romney said in Wednesday’s debate, “I figured out from Day 1 I had to get along, and I had to work across the aisle to get anything done.” The result, he said, was that “we drove our schools to be No. 1 in the nation. We cut taxes 19 times.”