Mitt Romney performed strongly in his first debate against President Obama, potentially reversing weeks in which his campaign appeared in disarray and delighting conservatives who had been openly worried about him losing badly to the president in November.

Romney’s campaign had been plagued by gaffes, particularly a video last month that showed him effectively casting 47 percent of Americans as people who want to rely on the government for their livelihood. But in the debate, the ex-governor aggressively attacked the president and defended his own record. He appeared unusually confident and eager, repeatedly interrupting both Obama and moderator Jim Lehrer to speak.

“You’ve been president four years. You said you’d cut the deficit in half. It’s now four years later. We still have trillion-dollar deficits. The CBO says we’ll have a trillion-dollar deficit each of the next four years. If you’re re-elected, we’ll get to a trillion-dollar debt,” Romney said.

Obama successfully poked holes in some of Romney’s record, most notably the former governor’s promise to reduce income taxes on most Americans but not increase the federal budget deficit or raise taxes on the middle class. Non-partisan analyses have suggested this is mathematically impossible, and Romney appeared to concede he would have to limit his tax cuts if they would balloon the deficit.

The president also pressed Romney on the lack of details on his proposals to balance the budget.

“If you are lowering the rates the way you described, Governor, then it is not possible to come up with enough deductions and loopholes that only affect high-income individuals to avoid either raising the deficit or burdening the middle class. It’s — it’s math. It’s arithmetic,” Obama said.

Overall, the president appeared to take a safe, cautious approach,  akin to a basketball team trying to run out the clock. He did not highlight Romney’s 47 percent remark, the Republican nominee’s refusal to release his tax returns or his controversial work at Bain Capital.

Obama leads in most national polls and in key swing states, and it’s not clear either candidate’s performance will alter the fundamental dynamics of the campaign, in which Obama has had a narrow but steady lead.