With a third and final debate to go, both candidates appeared likely to secure their standing in an already tight race that portends a cliffhanger presidential vote.
On Wednesday, both campaigns will continue their focus on battleground states considered crucial to winning the White House.
Tuesday night saw Obama bring the desired energy sought by worried Democrats after the president's lackluster performance in the first encounter two weeks ago.
This time, a forceful Obama defended his policies and challenged Romney on shifting positions on key issues while arguing his Republican rival's proposals would favor the wealthy if elected on November 6.
Romney repeatedly attacked Obama's record, saying millions of unemployed people and a sluggish economic recovery showed the president's policies had failed.
A snap CNN/ORC International poll indicated that 46% of respondents thought Obama won, compared to 39% for Romney. The result was within the survey's margin of error, and responses to other questions showed the overall impression was generally positive for both candidates.
After the first debate on October 3 in Denver, a similar poll showed Romney scored a solid victory in the eyes of more than 60% of respondents.
"Most improved -- that award goes to Barack Obama," CNN Senior Political Analyst David Gergen said, comparing the president's performance on Tuesday to his previous showing. "I think he had a much stronger debate tonight."
Daily Beast's Andrew Sullivan, who called Obama's poll numbers after the first debate "devastating," predicted the president would come "kicking back in the polls" in coming days.
Erick Erickson, the conservative RedState.com blogger and CNN contributor, thought Romney won the debate based on "clear majorities outside the margin of error" in the CNN/ORC poll who thought Romney would be better for the country on economic issues.
"In fact, while other areas of the debate may overshadow this point, Romney deftly dispatched Obama on his economic record," Erickson said, calling it "the one issue that matters."
Both candidates walked the floor with microphones in hand at Hofstra University in Hempstead, New York, raising their voices at times and repeatedly challenging each other's points during the 90-plus minute debate that featured a town hall-style format.
Moderator Candy Crowley, the CNN chief political correspondent, tried in vain at times to prevent each candidate from going over allotted time, with Obama speaking for more than three minutes longer than Romney on the night.
Obama was on the attack from the start, but waited until his final answer -- with no chance for Romney to respond -- to raise his opponent's controversial "47%" comments at a fundraiser in May.
In remarks made public by a secretly recorded video of the event, Romney described 47% of the country as people dependent on government aid who refused to take personal responsibility.
"Think about who he was talking about," Obama said, listing people on Social Security "who've worked all their lives," veterans "who've sacrificed for this country," students, soldiers and "people working hard every day."
The president said he wanted to fight for those people "because if they succeed, I believe the country succeeds."
Earlier, Obama went after Romney's five-point economic plan that the GOP candidate repeated two times during the second debate, saying it really was a one-point plan "and that plan is to make sure that folks at the top play by a different set of rules."
Romney shot back that "if you elect President Obama, you know what you're going to get -- you're going to get a repeat of the last four years."
Over and over, Romney repeated what he called the failings of Obama's policies including rising federal deficits and debts, more than 20 million people unemployed and anemic economic growth.
"We don't have to settle for what we're going through," Romney said at one point. "We don't have to settle for gasoline at four bucks. We don't have to settle for unemployment at a chronically high level. We don't have to settle for 47 million people on food stamps. We don't have to settle for 50 percent of kids coming out of college not able to get work. We don't have to settle for 23 million people struggling to find a good job."
Obama was "great as a speaker, but his policies don't work," Romney said. Attempting to rebut Obama's criticism of his own policies, Romney insisted he would prioritize middle class growth, saying "it's about how we can get the middle class of this country a bright and prosperous future."
However, Romney failed to provide further specifics of his tax policy, even when one audience member asked about unspecified deductions and loopholes the candidate says he will eliminate.
On a sensitive foreign policy topic, the candidates clashed at the front of the stage over the September 11 terrorist attack in Libya that killed four Americans, with Romney suggesting the Obama administration played politics by failing to immediately acknowledge what happened.
Obama shot back that the suggestion anyone in his administration would play politics on such an issue was "offensive." When Obama said he called it a terrorist attack shortly after it occurred, Romney challenged him, and Obama responded "check the transcript."
Crowley cut in to say both men were right -- Obama referred to terrorism shortly after the attack, but the administration took longer to fully explain what occurred.
Unlike the first presidential debate, the town hall-style format allowed audience members to ask the questions. Crowley, the first woman to serve as moderator of a presidential debate in 20 years, tried to get in as many questions as possible from the uncommitted voters in the hall, sometimes struggling to cut off the candidates as they tried to make points or argued with each other.
The first question came from a 20-year-old college student, worried about whether he'd be able to support himself after graduation.
"More debt and less jobs. I'm going to change that. I know what it takes to create good jobs again," Romney said, addressing the first-time voter. "When you come out in 2014 -- I presume I'm going to be president -- I'm going to make sure you get a job."
Later questions addressed immigration, with Romney saying Obama failed to deliver on a promise to pass a major immigration overhaul while the president said Romney backed conservative positions such as opposing a measure that gives some children of unregistered immigrants a path to legal status.
Obama repeated his past criticism that Romney's tax plan doesn't add up, saying "when he's asked how are you going to do it, which deductions, which loopholes are you going to close, he can't tell you."
"You're going to be paying for it," Obama said of middle class taxpayers. "You're going to lose some deductions, and you can't buy the sales pitch. Nobody who's looked at it that's serious actually believes it adds up."
Romney, meanwhile, repeatedly insisted his plan won't raise taxes for middle class Americans but also won't raise or lower the tax burden on the wealthy, in contrast to Obama's proposal to let tax rates on the top 2% of wage earners return to higher tax rates from the Clinton era.
The president needed a strong debate to try to blunt Romney's rise in the polls after their first showdown. The most recent CNN "poll of polls" -- an aggregate of the latest major surveys -- showed Romney with a slight edge nationally at 48%-47%.
In the battleground states considered up-for-grabs, polls show Romney has narrowed Obama's lead or caught the president.
The Obama campaign conceded he had a bad night in the first debate and promised a more aggressive approach in New York. A third and final debate focusing on foreign policy will take place October 22 in Florida.
Polls show voters consider the economy to be the most important election issue.
Unemployment fell below 8% in September for the first time since the month Obama took office in 2009. However, continuing high unemployment and slow growth have made the president vulnerable.
Romney and his campaign have sought to frame the election as a referendum on Obama's presidency, citing joblessness, slow recovery from the recession and chronic federal deficits and debt as reasons to deny a second term.
For their part, Obama and Democrats have tried to make the election about competing visions for the future. They argue Republican proposals to repeal major legislation, such as health care and Wall Street reforms, while cutting government and expanding tax cuts without identifying additional revenue sources would stall a sluggish but steady recovery.
CNN's Dana Ford contributed to this report.