US President Barack Obama has urged pressure and diplomacy to prevent Iran from getting a nuclear bomb while Israeli prime minister Benjamin Netanyahu has emphasised his nation's right to a pre-emptive attack.

Even in proclaiming unity, neither leader gave ground on how to resolve the crisis during talks in Washington.

Seated together in the Oval Office, Mr Obama and Mr Netanyahu at times tried to speak for each other, and other times spoke past one another.

The president and prime minister are linked by the history and necessity of their nations' deep alliance, if not much personal warmth, and both sought to steer the Iran agenda on their terms.

"I know that both the prime minister and I prefer to resolve this diplomatically," Mr Obama said. "We understand the costs of any military action."

If he agreed, Mr Netanyahu said nothing about sanctions or talks with Iran, or Mr Obama's position that there still is time to try to deter Iran peacefully.

Instead, Mr Netanyahu drew attention back to Mr Obama's acknowledgement that Israel is a sovereign land that can protect itself how it sees fit.

"I believe that's why you appreciate, Mr President, that Israel must reserve the right to defend itself," Mr Netanyahu said.

Israel, he added, must remain "the master of its fate".

Israel has not yet decided whether to launch a unilateral strike on Iran, a point underscored in the White House meetings.

Across days of comments, speeches and interviews, Mr Obama and Mr Netanyahu left no doubt about where they stand on Iran.

Far less clear is whether they have done anything to alter each other's position in what has become a moment of reckoning over Iran, and an important foreign policy issue in the US presidential race.

Both are adamant Iran must not develop a nuclear bomb. Mr Obama's aim is to keep Israel from launching an attack on Iran's nuclear facilities, fearing that would do little lasting good toward the goal and engulf the region and the United States in another war.

Senior Obama administration officials said the talks at the White House left the two sides closer than they were a week ago.

The Israelis walked away with prominent statements from Mr Obama that he would not stand for containing a nuclear-armed Iran, and that the crisis was in the United States' interests to solve.

In turn, Israelis did acknowledge privately they would prefer a diplomatic solution, despite enormous scepticism about the Iranian government, officials said.

And there were no demands that Mr Obama set a new "red line" of what it would take for a US strike - the US position remains that Iran must not get a nuclear weapon.

Mr Netanyahu emphasised that Israel must defend itself from an Iranian nuclear threat.

He said after his talks with Mr Obama: "I think I was listened to and understood."

The last time the two men met in the Oval Office, in May, Mr Netanyahu lectured Mr Obama in front of reporters as differences over Mideast peace unfolded.

This time, their body language as they spoke was not so glaring but still telling: Mr Obama addressed the media; Mr Netanyahu spoke directly to Mr Obama and locked on him.

Sign up to our free newsletters

Get the best updates straight to your inbox:
Please select at least one mailing list.

You can unsubscribe at any time by clicking the link in the footer of our emails. We use Mailchimp as our marketing platform. By subscribing, you acknowledge that your information will be transferred to Mailchimp for processing.