President Barack Obama needed a strong performance on Tuesday night to show he did indeed want a second term. And that he was willing to work for it. He delivered.
Republican challenger Mitt Romney did fine too, despite a few slips. He was able to keep the focus on the state of the economy, blaming the president for the sluggish recovery.
It was a closely contested debate, marked by testy exchanges. But Obama had the upper hand. The president was declared the winner in two polls conducted immediately after the debate - 46% to Romney's 39% in a CNN poll and 37% to Romney's 30% in the one by CBS TV network.
"President Obama came with more specifics tonight, and a greater willingness to both attack Mitt Romney and respond to Romney's attacks," said Mitchell McKinney, who has studied presidential debates.
The two clashed on every issue that came up - jobs, energy, economy, taxes, student loans, equal pay, health care, foreign policy and trade with China.
"And governor Romney says he's got a five-point plan?" Obama said in an exchange on fixing the economy. "Governor Romney doesn't have a five-point plan. He has a one-point plan. And that plan is to make sure that folks at the top play by a different set of rules."
Romney was equally forceful in his criticism of the president on broken promises of fixing the economy, creating jobs, bringing a legislation on immigration.
But he blew the best chance he had of getting the president.
"Many expected that Obama would be in trouble when the conversation turned to Libya," said Marc Hetheringotn of Vanderbilt University.
"Romney did not use the question to his advantage and ended up being accused of using the tragedy for political gain."
The President looked like he had learnt some lessons from his performance in the first debate. He rarely looked down during the 90-minute debate, for instance, and in the rare instance that he did, he jerked back up right away.
Obama campaign aides have said the president watched recordings of the Denver debate several times to see what he had done wrong then.
At Hofstra University, venue of the second presidential debate, Obama looked engaged, ready to talk about his plans and just as ready to tear apart Romney's.
The other big criticism was his failure to attack Romney.
The president later said he was being polite. Tuesday night, Obama came out swinging. He attacked repeatedly and forcefully. And saved the best for the last - the reference to Romney's "47%" comment in his closing remarks when Romney couldn't rebut.