JERUSALEM — President Obama and Israeli Prime Minister Benjamin Netanyahu expressed an unusual degree of solidarity Wednesday on a set of shared national security concerns that have divided them in the past, signaling either a turn in their vital, if volatile, relationship or a cool tactical display of diplomatic theater.

The leaders’ joint appearance concluded a tone-setting first day of Obama’s first presidential trip to Israel, a visit celebrated with military ceremony, children’s serenades and a rare personal chemistry with a hard-line Israeli leader with whom he has often bickered publicly.

In particular, Obama and Netanyahu, appearing at an evening news conference, reached what seemed to be a consensus regarding their views of Iran’s uranium-enrichment program.

Iran denies the program is designed to develop a nuclear weapon, despite mounting evidence to the contrary. Netanyahu and Obama, who advocates a diplomatic solution to the matter, have disagreed over how much time remains before a military strike against Iran is necessary to slow down the program.

Obama said recently that he thinks Iran is a year from achieving a nuclear-weapon capability, a timeline that has differed from Israeli assessments. On Wednesday, Netanyahu moved closer to Obama’s timeline — and even softened his certainty about Iran’s intent — to allow more space for diplomacy.

“I think that there’s a misunderstanding about time,” Netanyahu said. “If Iran decides to go for a nuclear weapon — that is, to actually manufacture the weapon — then it will take them about a year.”

Obama, in turn, reiterated his support for Israel’s right to self-defense. He pledged to seek additional funding for the Iron Dome system, which he saw when he swung by an anti-missile battery after his arrival at Ben Gurion International Airport.

The system, which shot down hundreds of Gaza-fired rockets in November, will receive $200 million in U.S. funding this fiscal year. Obama said he and Netanyahu will begin talks to extend the U.S.-Israeli military aid agreement beyond its current 2017 expiration.

“Israel’s security needs are truly unique, as I’ve seen myself,” Obama said. “And flying in today, I saw again how Israel’s security can be measured in mere miles and minutes.”

The warm display by Obama and Netanyahu comes against the backdrop of a rapidly changing Middle East, now shifting politically and culturally through war, protest and elections.

It is too soon to tell whether the two leaders have overcome past differences, which have played out in venues as public as the Oval Office. But the signs of a stronger U.S.-Israel relationship may apply new pressure on Iran’s leaders, who Obama said Wednesday must be convinced that it is not in their interest to pursue a nuclear weapon.

Obama’s visit to the prime minister’s official residence featured a surprising levity between two men whose public posture together has more often than not been dour, angry and hectoring.

Upon arrival at Netanyahu’s residence, Obama invited the prime minister’s wife, Sara Netanyahu, to stand between the two for a photo. “A rose between the thorns,” Obama joked.

He and Netanyahu, appearing relaxed and jovial, chatted while Obama signed a guest book. The prime minister complained about how hard it was to form a government in Israel’s multi-party system, telling Obama, “You have only one party” to compete with.

“The grass is always greener, my friend,” Obama replied.

When Obama later teased Netanyahu during the news conference that his “handsome sons” got their looks from their mother, a grinning Netanyahu responded, “I could say the same thing about your daughters.”

And as Israeli television captured the president’s arrival live, a shot of Obama removing his suit coat to stroll along the tarmac captured Netanyahu doing the same moments later, a strutting camaraderie not seen previously from the two leaders.

Obama is packing a lot into his three-day trip to Israel and the occupied West Bank, where he is scheduled to meet today with Palestinian Authority President Mahmoud Abbas and Prime Minister Salam Fayyad.

The trip, on which he is accompanied by his new secretary of state, John Kerry, is a mission of remedial diplomacy after a difficult first term with the United States’ closest Middle Eastern ally and a deeply disillusioned set of Palestinian leaders.

Obama’s early demand that Netanyahu cease settlement construction in the West Bank and East Jerusalem — areas, along with Gaza, that Palestinians consider part of their future state — created a rift that became a bitter campaign issue in last year’s U.S. election.

In his 2009 address to the Islamic world in Cairo, Obama said he would not accept the “legitimacy” of continued Israeli settlement construction in the occupied territories, activity that many legal experts say violates international law.

His decision not to stop in Israel after that speech — he instead visited the Buchenwald concentration camp in Germany to highlight Jewish suffering during the Holocaust — raised concern among many Israelis that Obama did not understand their nation’s biblical roots.

Immediately on arrival, Obama began to address those lingering concerns, which stirred resentment even among a slice of the Israeli electorate that supports the creation of a Palestinian state.

As he spoke from the airport tarmac, Obama began with a simple “Shalom,” the common Hebrew salutation, which, literally translated, means “peace.” He then set out to repair the mistaken impression he left during his first term.

“More than 3,000 years ago, the Jewish people prayed here, tended the land here, prayed to God here,” Obama said at the welcome ceremony. “And after centuries of exile and persecution, unparalleled in the history of man, the founding of the Jewish state of Israel was a rebirth, a redemption unlike any in history.”

In addition to the Iranian nuclear program, Obama and Netanyahu said they agreed on the dangers posed by the widening civil war in Syria.

Obama defended his policy toward Syria — where an estimated 70,000 people have been killed — citing the international sanctions he has helped organize against President Bashar Assad’s government.

But he also said that the use of chemical weapons by Syria’s government, which Syrian rebels alleged occurred on Tuesday, would be a “game-changer” prompting a more direct, if unspecified, U.S. response.