US President Barack Obama received an enthusiastic, even rapturous, reception from a young audience in Jerusalem on Thursday when he crowned his first official visit to Israel with a speech that seemed designed to at once woo Israelis, calm their fears and prod them toward a peace agreement with the Palestinians.

The key phrase was delivered in Hebrew.

“So long as there is a United States of America,” Obama said, “Atem lo levad.” That’s Hebrew for “You are not alone.”

Obama had a friendly, clearly left-leaning crowd of about 1,000, mostly university students and reporters, who applauded loudly and often. The speech was marred only once when a pro-Palestinian protester shouted from the hall.

The interruption came a moment after Obama mentioned the “lively debate” in Israeli society, and he referenced his comment — “That’s the lively debate we were talking about” — without losing his grin or his composure, earning a standing ovation from the crowd as the heckler was removed.

The cool attitude toward Israel that Obama displayed in his first term has been dramatically replaced during this visit by a warm, almost Clintonesque charm offensive that appears to be working.

“We’re so easy,” said Channel 2 TV’s political reporter, Udi Segal, after the speech. “Twenty-four hours, a few hugs, and that’s it.” Not doing this four years ago might be remembered as one of the foreign policy errors of Obama’s first term.

In an official response released after the speech, Prime Minister Benjamin Netanyahu thanked Obama for his “unconditional support for Israel” and said he agreed that they must work toward a “peace that guarantees the safety of all Israeli citizens.”

Obama opened his speech with a pop culture reference, joking that his disagreements with Netanyahu — now “my friend Bibi” — had actually been a plot to generate material for Eretz Nehederet, or “A Wonderful Country,” a popular TV satire show. That got a laugh.

In a sign of the remarkable display of affection, genuine or not, between Obama and Netanayahu, the Israeli prime minister’s official response Thursday evening included a humorous reference to that line from the speech and to the closing line of every episode of the show: “Prime Minister Netanyahu,” read the statement, “agrees with President Obama that we have a wonderful country.”

US President Barack Obama speaks to an audience of Israeli students at the International Convention Center in Jerusalem on Thursday afternoon. (AP Photo/Pablo Martinez Monsivais)

US President Barack Obama speaks to an audience of Israeli students at the International Convention Center in Jerusalem on Thursday afternoon. (AP Photo/Pablo Martinez Monsivais)

Obama also spoke about the festival of Passover, which begins next week, and its message of freedom.

He expressed sympathy for Israelis living with rocket fire, saying “children the same age as my daughters” went to bed with the fear of rockets “because of who they are and where they live.” He mentioned the five Israelis killed by terrorists in Bulgaria, and said Hezbollah, thought to be behind the attack, should be called “what it truly is — a terrorist organization.”

But Obama also spoke of the plight of the Palestinians, noting the presence of a “foreign army” controlling their movement, settlement construction, and a failure to punish violence by settlers. Just as Jews deserve independence, so do Palestinians, he said.

He recounted meeting a group of young Palestinians earlier in the day. They were not different from his own daughters, he said, or from Israelis their age.

Given demographics, he said, the only way for Israel to survive as Jewish, democratic nation is by the creation of an “independent and viable Palestine.”

Israel needs peace because “no wall will be high enough” to keep out every threat, he said, and “security must be at the center of any agreement.”

The US, he promised, “will oppose unilateral efforts to bypass negotiations through the United Nations.” But the Palestinian “right to justice” needs to be recognized.

He quoted Ariel Sharon saying that if Israel pursues control of all of the land of Israel, it will “lose it all.” (He also quoted David Ben-Gurion, Israel’s first prime minister, and name-checked Likud leader Menachem Begin and Labor leader Yitzhak Rabin, which, along with the reference to the satire show, achieved impressive coverage of Israel’s ideological spectrum.)

He praised Palestinian President Mahmoud Abbas and Prime Minister Salam Fayyad as real partners. “There’s an opportunity. There’s a window,” he said. “Peace is possible.”

Most Israelis, even moderates, are highly skeptical of that point. Palestinian leaders turned down Israeli peace proposals in 2000, 2001, and 2008. The Islamists of Hamas now control Gaza, and could well come to power in the West Bank after any Israeli withdrawal. Few Israelis believe that a peace agreement of the kind envisioned in the 1990s is a real possibility.

But Obama was not specific about what he was calling on Israel to do, expressing instead a hope that Israelis will pressure their leaders to pursue peace. Earlier in the day, he made clear that he opposes preconditions to talks — a reversal of his first term, when he introduced a demand for a settlement freeze that played a part in deadlocking negotiations for several years.

He reminded listeners that Israel is “the most powerful country in this region, and has the support of the most powerful country in the world.” Israel, he seemed to mean, can afford to take risks.

Of Iran’s nuclear program, a major bone of contention during his first term, he said, “It’s no wonder Israelis view this as an existential threat.” It is a threat to the US as well, he said.

But Iran is “under more pressure than ever before and that pressure is increasing,” thanks to US-led sanctions, and there is a joint interest in resolving this “peacefully,” through “strong and principled diplomacy.”

But “all options are on the table,” Obama said: “America will do what we must to prevent a nuclear-armed Iran.”

Noa Regev, a student from the Technion in Haifa, said not everyone in the hall was enamored of the speech.

“It might have looked to you that the whole hall was clapping in agreement, but where I sat I heard enough people moaning, ‘What’s he talking about?'” she said.

“But I thought it was great. It’s good he didn’t just come here to butter us up,” Regev said.

Raphael Ahren contributed to this report.