What a difference a week makes. In the first presidential debate, President Obama let Mitt Romney’s attacks on him stand, and seemed disengaged. Vice President Joe Biden stayed in Rep. Paul Ryan’s face for the entirety of Thursday’s vice presidential debate. In the process, he forced Ryan, and by extension the Romney campaign, onto the defensive for a large part of the evening. Obama has a lot to be grateful for.

Last week, Romney repeated over and over that the president’s health care bill cut $716 billion. Obama didn’t push back much to explain that the cuts came from providers and insurance companies, not beneficiaries. This week, Ryan was forced again and again to answer for his voucher/”premium support” approach to Medicare, which Biden hammered at relentlessly.

Last week, Romney flatly denied he had proposed $5 trillion in tax cuts. This week, Ryan had to keep dodging the question of what middle-class deductions would have to be eliminated to pay for the tax cuts. The moderator, Martha Raddatz, who effectively challenged both candidates throughout the debate, at one point turned to Ryan and asked: “No specifics again?” The discussion revived an issue Obama badly needs in play.

And Ryan made a major mistake in defending his past support for privatizing Social Security. Last week, Obama made a mistake of his own when he said that his position and Romney’s on Social Security were similar, thereby closing off a matter that has always been a Democratic staple. The Republicans should have let things sit right there. Instead, Ryan brought the privatization issue to life. His standing his ground on his Social Security ideas (rather than simply saying that Romney had no plans to move in that direction) will allow the Democrats to add Social Security to Medicare in their arsenal of issues they hope to use to cut Republican margins among seniors.

Biden was hot, avuncular, occasionally sarcastic, and always engaged. He laughed a lot, and never let a point slip. I am certain that the cheers in Democratic living rooms around the country were as loud as the sighs of relief. That alone was vital to Obama. Demoralized Democrats themselves contributed to the story line of Obama’s failure in the first debate. The days of demoralization are over.

Some will no doubt write that Biden was too hot and overreacted to Obama’s disengagement. But this misreads the net impact of the debate, which was to renew the doubts about Romney, Ryan and their approach that were hurting the GOP before the last debate. Biden stayed on Romney’s class bias from the beginning to the end — he was not shy, as Obama was, about mentioning Romney’s 47 percent comments. A Romney presidency, Biden said, would concentrate on “taking care only of the very wealthy.”

Ryan probably did himself some good with his conservative base, and he generally preserved his cheerful demeanor. The debate will help advance his chances for a 2016 Republican nomination if the Romney-Ryan ticket loses this year. But his main tasks on Romney’s behalf were to keep the momentum from last week’s debate going and to keep the campaign colloquy focused on Obama’s weaknesses. In this, he failed. The news is likely to shift again toward the problems with Romney’s ideas, and with Ryan’s own. A particularly revealing moment was Ryan’s heartfelt defense of his staunch opposition to abortion. It was an honest answer that will keep him in good stead with conservatives, but it almost certainly hurt Romney, who has been trying to soften his stance on the subject.

In 2004, after John Kerry’s clear victory over George W. Bush in the first presidential debate, then-Vice President Dick Cheney came out on top in most of the commentary about his encounter with John Edwards. Cheney thereby slowed Kerry’s momentum. Dick Cheney has never been Joe Biden’s role model, but Biden’s imperative Thursday night was the same as Cheney’s eight years ago. And with a very different style, he achieved the same result. It will now be Obama’s task to pick up where Biden left off, but the vice president clearly brought his president back to a much better place.

E.J. Dionne’s e-mail address is ejdionne(at)washpost.com.