President Barack Obama issued his most direct threat yet of U.S. military action against Iran if it builds a nuclear weapon, but in a message to Israel's leader ahead of White House talks he also cautioned against a pre-emptive Israeli strike.

As president of the United States, I don't bluff, Obama warned Iran in a magazine interview published on Friday, three days before a crucial meeting with Israeli Prime Minister Benjamin Netanyahu.

With the talks expected to be dominated by stark differences over what Washington fears could be an Israeli rush to attack Tehran's nuclear sites, Obama's remarks appeared intended to offer some degree of the assurances that Netanyahu has demanded for greater public resolve against Iran.

Netanyahu, on a visit to Canada on Friday, sought to avoid widening the rift with Obama but insisted on the right to preserve freedom of action of the State of Israel in the face of threats to wipe us off the map.

Monday's meeting is shaping up as the most consequential encounter of U.S. and Israeli leaders in years. Tensions have been magnified in a U.S. election year, with Republican presidential contenders slamming Obama as too soft on Iran and too hard on Israel, a close ally.

Further complicating the situation is a trust deficit between Obama and Netanyahu, who have had an often strained relationship.

There is mounting speculation that Israel, which fears that time is running out to stop Iran as it buries nuclear facilities further underground, could act militarily on its own in the coming months unless it receives stronger reassurances from Washington.

Netanyahu is trying to convince Obama to more forcefully define the nuclear threshold that Iran must not cross and the consequences it would face if it did so.

The U.S. president, who told the Atlantic that he has Israel's back, wants to convince the right-wing Israeli leader to hold off on any unilateral strike and give sanctions and diplomacy more time to work. Iran remains defiant but denies it is trying to develop nuclear weapons.

TALKING TOUGH

Both leaders talked tough ahead of their meeting.

I think both the Iranian and the Israeli governments recognize that when the United States says it is unacceptable for Iran to have a nuclear weapon, we mean what we say, Obama told the Atlantic magazine.

Obama repeated the U.S. refrain that all options are on the table, but spoke in his most direct terms yet of a possible U.S. military response if sanctions and diplomacy fail to curb Tehran's nuclear ambitions.

It includes a military component. And I think people understand that, Obama said when asked about U.S. intentions on Iran, which insists it is not trying to develop nuclear weapons.

While acknowledging Netanyahu's profound responsibility to protect the Israeli people, Obama cited potential unintended consequences as he made clear that it would be unwise for Israel to go ahead with any attack on Iran.

At a time when there is not a lot of sympathy for Iran and its only real ally, (Syria) is on the ropes, do we want a distraction in which suddenly Iran can portray itself as a victim? Obama said.

Obama cannot afford to be too tough on Netanyahu, with Republican presidential candidates ready to pounce on anything that might hurt the Democratic president with Jewish voters and other pro-Israel constituencies. He addresses a powerful pro-Israel lobby in Washington on Sunday.

At the same time, Obama's aides are also worried that a new war in the Middle East could create chaos in global oil markets, causing a further spike in U.S. gasoline prices, and draw Washington into another unwanted military conflict.

It was unclear, however, whether Obama's sharpened rhetoric on Iran would do much to placate Netanyahu, who flies to Washington on Sunday.

ISRAELI DEMANDS

Netanyahu on Friday urged world powers not to pursue new talks with Iran, which faces sanctions that could cripple its oil exports, and he challenged Tehran with a list of demands.

He said Iran must dismantle an underground nuclear facility near the city of Qom, stop uranium enrichment and remove all uranium enriched above 3.5 percent from the country.

I think the international community should not fall into this trap, he told reporters in Ottawa after talks with Canadian Prime Minister Stephen Harper.

But seeking to lower the temperature ahead of his meeting with Obama, Netanyahu said: I have not set, and we do not intend to set, red lines for the United States.

An Israeli official had earlier quoted Netanyahu telling top Obama aides who visited Jerusalem last month: If you don't want me to attack now, I want guarantees.

The White House has signalled that Obama, who has pledged to prevent Iran from building a nuclear weapon but has been vague on how far he is prepared to go, will resist pressure for a major policy shift.

Underscoring the gap between the two allies, the Israelis complain that the Obama administration is undercutting the deterrent effect of their threat to use force by publicly questioning the timing and wisdom of airstrikes on Iran.

Washington has been working to convince the Israelis that a go-it-alone attack would only be a temporary setback for Iran.

A source close to the administration's thinking on Iran said the president might try to mollify some of Netanyahu's concerns in private and could pledge more sanctions.

U.S. officials doubt that Netanyahu will provide assurances that Israel will consult Washington - its biggest source of military assistance - before launching any strikes on Iran, which has called for the destruction of the Jewish state.

Even if Obama privately reassures Netanyahu that the United States has the firepower to deliver a devastating blow to Iran's nuclear program further down the line, the Israelis have made clear they cannot rely on that commitment alone.

One line of thinking within the Obama administration is that keeping it in the dark about any Israeli military plans might be best for the United States since any sign of complicity would inflame anti-American sentiment in the Muslim world.

(Additional reporting by Caren Bohan; Editing by Anthony Boadle and Stacey Joyce)