JERUSALEM — President Obama, appealing to very disparate audiences to solve one of the world’s thorniest problems, moved closer on Thursday to the Israeli government’s position on resuming long-stalled peace talks with the Palestinians, even as he passionately implored young Israelis to get ahead of their own leaders in the push for peace.

Addressing an enthusiastic crowd of more than 2,000, Mr. Obama offered a fervent, unsparing case for why a peace agreement was both morally just and in Israel’s self-interest. Younger Israelis, Mr. Obama said, should empathize with their Palestinian neighbors living under occupation — or, as he put it, “look at the world through their eyes.”

Hours earlier, visiting the Israeli-occupied West Bank, Mr. Obama urged the Palestinians to return to the bargaining table even if Israel did not meet their condition of halting construction of Jewish settlements in Palestinian territories — a demand he, too, made at the start of his first term, but which had only a temporary, partial impact.

It was a striking mix of big-stage inspiration and closed-door compromise: with the Palestinian president, Mahmoud Abbas, and Prime Minister Benjamin Netanyahu, Mr. Obama was laboring to nudge two stubborn adversaries; with a younger generation, he was going over the two men’s heads, seeking to stir popular enthusiasm for his vision of peace.