Vice President Biden and Rep. Paul Ryan squared off Thursday night in this year’s lone vice-presidential debate, playing roles that few would have expected two weeks ago.

For Ryan, the job was to keep up a sudden surge of Republican momentum. For Biden, by contrast, the job was to find a way to stop it.

The debate began with a discussion of Libya, where an attack on a U.S. consulate on Sept. 11 killed four Americans, including Ambassador J. Christopher Stevens. Ryan sought to portray that attack — and the administration’s varying explanations of it — as indications of a weakness in President Obama’s foreign policy.

“What we are watching on our TV screens is the unraveling of the Obama foreign policy, which is making . . . us less safe,” Ryan said.

Biden retorted with the night’s first one-liner, defending the administration’s handling of the issue.

“With all due respect, that’s a bunch of malarkey,” he said, interrupting Ryan.

Neither had faced a debate quite like this one. In 2008, Biden had a much different opponent in then-Alaska Gov. Sarah Palin (R), who had little experience in national politics.

Biden and Ryan spent weeks preparing for their 90 minutes. Ryan held at least three rehearsals, then spent days in a “debate camp” in Virginia. Biden’s aides went so far as to construct a mock-up of the debate set for the vice president’s practice sessions in Wilmington, Del., according to a CNN report.

Earlier Thursday, Republican presidential nominee Mitt Romney had a 30-minute meeting with evangelist Billy Graham, 93, at Graham’s estate in Montreat, N.C. It was the first time that Romney met Graham, who has led religious revivals for more than 50 years and met with every U.S. president since Harry S. Truman.

The meeting was closed to reporters, but photographers and television producers were permitted to record its final moments. The two discussed the death of George Romney, the candidate’s father, whom Graham knew.

Graham then asked Romney what he could do to help.

“Prayer is the most helpful thing you can do for me,” the candidate said. “And what you’re planning, what your son has shown me is going to be very, very helpful. And I appreciate that. It’s going to be terrific.”

Graham, Franklin Graham and Romney then prayed and as the meeting ended, campaign aides said that Billy Graham told Romney: “I’ll do all I can to help you. And you can quote me on that.” However, aides did not respond to requests for clarification about what Romney meant regarding Franklin Graham’s plans.

Meanwhile, Obama spoke in Miami, and criticized Romney for the more moderate tone he has taken in recent weeks.

“He’s trying to go through an extreme makeover,” Obama said. “After running for more than a year in which he called himself ‘severely conservative,’ Mitt Romney is trying to convince you that he was severely kidding.”

Also, Obama’s campaign continued to face criticism over the administration’s handling of the Sept. 11 attack in Benghazi, Libya, that killed the U.S. ambassador there and three other Americans.

The administration has repeatedly revised its account of what happened and who was behind the attack. But in an interview on CNN, campaign spokeswoman Stephanie Cutter suggested that the attack had become a major issue because Republicans had politicized it.

“The entire reason that this has become the political topic it is, is because of Mitt Romney and Paul Ryan,” she said.

Romney, at a campaign event in Asheville, N.C., replied: “No, President Obama, it’s an issue because this is the first time in 33 years that a United States ambassador has been assassinated. . . . This is an issue because the American people wonder why it took so long for your administration to admit that this was a terrorist attack.”

Both vice-presidential candidates did private walk-throughs on the debate stage on Thursday. As the hours ticked down, the two camps discussed their strategies only in the flat platitudes that are traditional at such moments.

“Joe Biden, as he always does, will speak the truth,” said Jim Messina, Obama’s campaign manager.

Ryan told reporters on Wednesday that he was looking forward to the debate, and sought to lower his expectations by pointing to Biden’s experience on the national stage.

There have been eight vice-presidential debates since 1976. Usually, they don’t matter much. Even the most famous iterations — such as the 1988 exchange, in which Democrat Lloyd Bentsen cut down Republican Dan Quayle with the line, “Senator, you’re no Jack Kennedy” — had little impact on national polls.

But this year could be different.

In the first presidential debate last week, Romney managed to undo weeks of frustration in a single night. He looked sharp, energized, and in command of numbers and policies. Obama, by contrast, appeared tired and unfocused.

Afterward, for the first time in months, the Republican edged slightly ahead in some national polls. Obama, however, still seems to hold an advantage in the swing states that will decide the electoral college.

On Thursday night, Ryan hoped to extend the surge that Romney started. But he faced a delicate task: He has built his career around specific, strongly conservative ideas for the federal budget and programs such as Medicare.

Romney has said he would not adopt Ryan’s ideas wholesale. But Biden was expected to try to seize on Ryan’s budget anyway, to support attacks that the Republican ticket is too conservative.

For Biden, the night’s task was to project the energy that Obama lacked, without stumbling into a verbal gaffe.

To prepare, Biden spent three days rehearsing at a hotel in Wilmington with nights spent at home with his family in the same city. His routine consisted of morning policy sessions and afternoon mock debates against a Ryan stand-in, Rep. Chris Van Hollen (D-Md.), and further briefings in the evening.

Biden communications director Shailagh Murray, a former Washington Post reporter, played the role of moderator Martha Raddatz of ABC, a campaign official said.

For Ryan, the lead-up to the debate included three days of “debate camp” in Wintergreen, Va., as well as two days this week in St. Petersburg, Fla. He has held multiple mock debates against former solicitor general Theodore B. Olson, his Biden stand-in. Former Massachusetts lieutenant governor Kerry Healey (R) has played moderator.

Both candidates spent their night before the debate eating dinner with family members. For Ryan, that dinner was at the hotel in Lexington, Ky. For Biden, it was in Wilmington, where he and relatives dined on homemade lasagna.

Ryan spent the early part of Thursday with his family, studying his policy binders and exercising. He ate a tuna salad sandwich for lunch and will eat salmon with rice for dinner, an aide said.

Fahrenthold reported from Washington.