The US Democratic presidential candidate, Barack Obama, called for tighter sanctions on Iran today after it fired nine test missiles that were capable of hitting American and Israeli bases.

"Iran is a great threat. We have to make sure we are working with our allies to apply tightened pressure on Iran," the Illinois senator said.

Iran demonstrated its military force with the test-flight of nine long and medium-range missiles in the strategic Strait of Hormouz, through which 40% of the world's oil passes.

Tehran said the exercise was in retaliation to threats from the US and Israel over its disputed nuclear projects, which it claims are civilian.

Obama said if he were to be elected president, he would combine more direct diplomacy with the threat of much tougher economic sanctions.

"I think what this underscores is the need for us to create a kind of policy that is putting the burden on Iran to change behaviour, and frankly we just have not been able to do that over the last several years," Obama said.

He cited reports that US exports to Iran have increased under George Bush, even as the administration has toughened its rhetoric.

Earlier, the US secretary of state, Condoleezza Rice, said the "war games" justified America's defence plans with bases in eastern Europe. She said the tests were "evidence that the missile threat is not an imaginary one."

"Those who say there is no Iranian missile threat against which we should build a missile defence system perhaps ought to talk to the Iranians about their claims."

Her comments were backed by the Republican presidential candidate, John McCain. He said the tests "demonstrate the need for effective missile defence now and in the future, and this includes missile defence in Europe as is planned with the Czech Republic and Poland". These plans are strongly opposed by Russia.

But the Kremlin, which has resisted US calls for tougher UN sanctions on Iran, said it shared concerns about Tehran's nuclear programme.

Speaking from Japan, where Bush attended the G8 summit, the White House spokesman Gordon Johndroe said the Iranians should "refrain from further missile tests if they truly seek to gain the trust of the world".

"The Iranian regime only furthers the isolation of the Iranian people from the international community when it engages in this sort of activity," he said.

Washington said Iran's development of ballistic missiles violated UN security council resolutions. But it added that the US was committed to pursuing a diplomatic solution to the impasse over Iran's nuclear ambitions.

The practice shots by Iran's elite revolutionary guards were another in a series of conflicting messages coming out of the country over its nuclear programme and relations with the US and Israel.

General Hossein Salami, the guards' navy commander, told state television today that the test missiles exercise, called "The Great Prophet 3", would "demonstrate our resolve and might against enemies who in recent weeks have threatened Iran with harsh language".

An Iranian news agency quoted Salami as saying: "Our hands are always on the trigger and our missiles are ready for launch."

But less than a day ago, the Iranian president, Mahmoud Ahmadinejad, dismissed fears that Israel and the United States could be preparing to attack his country, calling the possibility a "funny joke".

At a press conference during a visit to Malaysia yesterday, Ahmadinejad said: "I assure you that there won't be any war in the future."

The G8 expressed "serious concern" over the risks posed by Iran's nuclear programme and urged Tehran to suspend all uranium enrichment-related activities.

"We call on Iran to respond to the updated incentives package in a constructive manner," a G8 statement said today. "We also urge Iran to act in a more responsible and constructive manner in the region, particularly in the context of the Middle East peace process and the stability of Iraq and Afghanistan."

Television reports said the missiles fired included a new version of the Shahab-3 missile, which officials have said has a range of 1,250 miles and is equipped with a conventional warhead weighing a tonne.

Such a missile could reach Israel, Turkey, Afghanistan or Pakistan.

The range of Iran's missiles

Israel's military has also flexed its muscles in recent months as tensions with Iran have risen, sending warplanes over the eastern Mediterranean in June.

US officials described that incident as a possible rehearsal for a strike on Iran's nuclear programme, which the west fears is aimed at producing atomic weapons.

Israeli government spokesman Mark Regev today said Israel "does not desire hostility and conflict with Iran".

"But it is clear that the Iranian nuclear programme and the Iranian ballistic missile programme is a matter of grave concern," he said.

Iran says its nuclear programme is geared only towards generating electricity, not producing weapons.

Last month, six major world powers offered a package of economic incentives to Iran if it halted nuclear activities. Tehran's response to that offer has not been made public.

For months, Ahmadinejad and other Iranian officials have played down the possibility of a US attack because they think difficulties in Iraq and domestic worries will deter America from engaging in another war.

At the same time, Tehran has stepped up its warnings of retaliation if the Americans - or Israelis - do attack, including threats to hit Israel and US Gulf bases with missiles and stop oil traffic through the vital Gulf region.