In this post-9/11 age, the idea of preemptive war against a terrorist-prone country supposedly went out of favor after the 2003 US invasion of Iraq.

Yet Congress is now pushing President Obama toward steps that could easily be interpreted as an act of war against Iran over its nuclear ambitions.

The House and Senate are moving quickly on a bill to force US sanctions on the sale of gasoline to the Islamic Republic of Iran. In theory, the measure would only punish US and foreign companies that export refined oil products to Iran which, despite being a major exporter of petroleum, lacks sufficient oil refineries.

But there’s a big problem: The only way to really enforce such a crippling sanction against the Iranian economy would be through an American-led naval blockade which, by international law, is an act of war.

In recent days, Iran’s regime has made it pretty clear that it is preparing to fight such a blockade, if it comes to that. Iran’s Revolutionary Guard Corps began a five-day sea, land, and air military exercise April 22 in the Persian Gulf and Gulf of Oman. The war games may even extend to the Strait of Hormuz, the watery chokepoint through which a fifth of the world’s oil flows on giant tankers, and which is guarded by the US Navy.

History is instructive here: It was a US ban on the export of oil to Imperial Japan for its invasion of China that triggered the 1941 attack on Pearl Harbor. And a US naval blockade of Cuba in 1962 almost led to nuclear war with the Soviet Union.

Also on April 22, the House of Representatives voted by a huge 403-11 margin to set a deadline of May 28 for an agreement with the Senate on the gasoline sanctions. In the Senate, too, patience with President Obama’s slow and often faltering approach to Iran is running thin.

“We have waited long enough for diplomacy to work,” says Senate majority leader Harry Reid. “Iran is a festering sore in the world.”

Mr. Obama may be able to fend off pressure from Congress to strangle Iran’s economy with sanctions on its gasoline imports. But much depends on whether countries like China, Russia, and even Germany are willing to impose other types of penalties that are more targeted at top members of the regime, especially the Revolutionary Guard and its affiliated companies. The toughest ones proposed by Obama focus on Iran’s access to banking, insurance, and credit. The White House hopes the UN Security Council will agree by early May to a package of new sanctions.

The US has been successful since 2006 in having the Council ratchet up pressure on Iran as that country further defies calls for it to open its secret nuclear program to international inspections. The West is especially worried about Iran’s rush to produce bomb-grade uranium.

China’s cooperation is essential. It recently hinted that it is ready to support some of Obama’s proposed sanctions. Critical to China’s support are offers from Arab oil exporters to make up for its loss of oil exports from Iran. Another signal of China’s support was a visit by its Navy to the United Arab Emirates last month.

Hovering over these moves is the threat of Israeli air attacks on Iran’s nuclear facilities. Israel did strike Iraq’s nuclear plant in 1981 and a Syrian one in 2007.

The US opposes such an Israeli operation, which could create an uncertain escalation of conflict in the Middle East. But some experts say the US would have a tough time restraining Israel if that country attacks Iran before the US elections this November. Support for Israel is very high in Congress.

US lawmakers need to be concerned that any unilateral US sanctions on gas imports to Iran could lead to a naval confrontation. Such a measure should only be taken with the widest international support and only if Iran appears ready to deploy a nuclear weapon that would destabilize the region. Similar conditions were not in place before President George W. Bush ordered the invasion of Iraq, and that war effort suffered for it.

Preemptive war, even if it only a naval blockade, should never be done lightly.