An energetic Mitt Romney launched a series of attacks against President Obama here Wednesday night, calling into question the president’s record on the economy, health care and the deficit, and arguing that he would take the country in a fundamentally different direction.

Obama sought to parry Romney’s criticisms, charging that his presidential rival favors a top-down approach to the economy that would reward the wealthiest Americans at the expense of the middle class and that the details of the Republican’s proposals don’t add up. But he found himself on the defensive repeatedly during their first debate, held at the University of Denver.

Romney came into the 90-minute exchange after several difficult weeks but appeared rejuvenated by the opportunity to take his case directly to Obama and the American people. He was well prepared and aggressive as he hammered the president. The contrast with Obama was striking, as the president appeared less energetic even as he rebutted some of Romney’s toughest attacks.

The debate is likely to give Romney what he needed most, which is a fresh look from voters — at least those who are undecided or open to changing their minds — and will change the conversation about the campaign, which for the past two weeks has been tilted in the president’s favor. Romney now faces the challenge of trying to build on his performance and keep the president on the defensive in the days ahead.

Romney offered conservative policies throughout the evening but he often sounded more moderate than he does in campaign appearances. He is likely to face a challenge from Obama and the Democrats in the coming days about the contrast in tone and posture on display during the night.

But Republicans were immediately cheered by the aggressiveness they saw in Romney and took it as a sign that he will wage a fierce battle between now and Nov. 6.

PBS’s Jim Lehrer moderated the forum, which included a more open format that encouraged a free-flowing discussion, and most of the exchanges focused on the economy, the federal budget deficit and health care. The debate was generally civil and proved to be one of the most substantive and detailed in recent memory.

The weak economy has long been Obama’s biggest obstacle to reelection. On Wednesday, he argued that, although the country faces problems, it has begun to “fight our way back” because of his policies and the resilience of the American people.

“Over the last 30 months, we’ve seen 5 million jobs in the private sector created. The auto industry has come roaring back. And housing has begun to rise. But we all know that we’ve still got a lot of work to do. And so the question here tonight is not where we’ve been but where we’re going.”

But Romney said the status quo “is not going to cut it” for struggling families. “Under the president’s policies, middle-income Americans have been buried. They’re just being crushed. Middle-income Americans have seen their income come down by $4,300. This is a tax in and of itself. I’ll call it the economy tax. It’s been crushing.”

Romney clearly came to the debate determined to change his image as someone who cares little for ordinary Americans, a view that was heightened by his dismissive comments about the roughly 47 percent of Americans who pay no income taxes.

Throughout much of the early part of the debate, he sought to portray himself as a protector of the middle class, not the wealthy. He said that he would not raise taxes on middle-class families and that he would not reduce the share of taxes paid by the wealthiest Americans.

Obama, however, said that Romney’s tax plan would do just that. He said his rival favors a $5 trillion tax cut and argued that eliminating loopholes and deductions for the wealthiest Americans would not provide enough revenue to avoid deepening the deficit. He said Romney would either have to cut into middle-class benefits or reduce spending on vital programs.

“The magnitude of the tax cuts that you’re talking about, Governor, would end up resulting in severe hardship for people but, more importantly, would not help us grow,” the president said.

Romney repeatedly has declined to specify what loopholes and deductions he would eliminate and passed up opportunities to do so again Wednesday. But he said Obama had mischaracterized his tax plan, saying that it does not include a $5 trillion cut.

“Let me repeat what I said,” Romney said. “I’m not in favor of a $5 trillion tax cut. That’s not my plan. My plan is not to put in place any tax cut that will add to the deficit.”

Obama and Romney clashed over Medicare, with both promising to protect the health-care program for seniors. Obama accused Romney of wanting to turn it into a voucher program, while Romney claimed that the president cut $716 million from Medicare to help pay for the Affordable Care Act.

Romney was eager to launch into a critique of the landmark legislation that he cited as his top example of programs that must be eliminated to close the federal deficit. “I apologize, Mr. President,” Romney added after referring to the program as Obamacare. “I use that term with respect.”

“I like it,” Obama quickly responded, but that was about their only real point of agreement.

Romney argued that the program would raise health-care costs and make it less likely that businesses would hire new workers. He accused Obama of establishing an unelected board to make health-care decisions for patients, and of cutting more than $700 billion from Medicare to help pay for the law. And he chastised the incumbent for “pushing through” legislation of such magnitude without a single Republican vote.

“I just don’t know how the president could have come into office — facing 23 million people out of work, rising unemployment, an economic crisis at the kitchen table — and spend his energy and passion for two years fighting for Obamacare instead of fighting for jobs for the American people,” Romney said. “It has killed jobs.”

Obama pushed back, particularly on the point about the cut to Medicare, which he explained, and independent analysis has shown, does not include direct reductions to benefits for seniors but rather ratchets down payments to providers, including insurance companies.

The president noted that Romney has promised to repeal Obamacare on his first day in office, yet more recently has said he wants to keep some of its provisions, notably its protections for patients with preexisting conditions and the rights of young adults to remain on their parents’ insurance plans.

Obama also reminded viewers that his law was modeled heavily on the health-care law that Romney championed when he was governor of Massachusetts. “We’ve seen this model work really well in Massachusetts,” the president said.

“He now says he’s going to replace Obamacare and ensure that all the good things that are in it are going to be in there and you don’t have to worry,” Obama added. “And at some point, I think the American people have to ask themselves: Is the reason that Governor Romney is keeping all these plans to replace secret because they’re too good?”

Romney defended his plan in Massachusetts, saying he had not raised taxes and had pushed through the bill with significant numbers of Democratic votes.

On energy, Obama said Romney would continue to favor tax breaks for the oil industry. Romney retorted by noting that the Obama administration has invested more than $90 billion in green-energy projects, “about about 50 years’ worth of what oil and gas receives.”

On regulatory issues, Romney attacked the Dodd-Frank Wall Street Reform and Consumer Protection Act, which overhauled regulation of the financial industry, but he said that some regulations are needed and that he would keep them. Obama scoffed at Romney’s promise to repeal Wall Street regulation that he signed into law, saying: “Does anybody out there think that the big problem we had is that there was too much oversight and regulation of Wall Street? Because if you do, then Governor Romney is your candidate.”

Near the end of the debate, Lehrer asked the candidates how they might make Washington work more effectively. Romney said he would do what he had done with a Democratic legislature in Massachusetts: work out compromises.

Obama said that might be difficult if one of Romney’s first efforts were to repeal the Affordable Care Act, which he said would anger Democrats in Congress. And he accused Romney of being hostage to the most conservative elements of the Republican Party.

“I’ve got to tell you, Governor Romney, when it comes to his own party during the course of this campaign, has not displayed that willingness to say no to some of the more extreme parts of his party,” he said.

David Nakamura and Philip Rucker contributed to this report.