The US lacks the military manpower to effectively occupy Iraq or Afghanistan on their own. Even if the US completely pulls out of their wars on in these neighbours of Iran, this invasion will be a disaster.
However, I don't think that things would go as quickly as prior posters expect. Iran's military is significantly better led and better trained than that of Iraq, their weapons systems would likely be more of a threat and their bunkers are apparently cutting edge (to the point that the majority of Iranian bunkers may be proof against the US anti-bunker arsenal. So while we'll see a repeat of the pattern of the wars against Serbia and Iraq in that the US will within a few months at most take control of Iran's airspace and will be able to quickly shatter any large Iranian military formations, we're looking at something between "guerilla war on steroids" and "the Iranian military is never destroyed, only forced to remain dispersed and use hit-and-run tactics" (and yes, failure to actually destroy the Iranian military makes a BIG difference).
This coming in the latter part of the 2000s, at the height of oil prices, is not only going to wreck the economies of the major importers (China, India, Turkey, South Korea and Japan) since they will need time (and lots of money) to refit their refineries to accept crude from other sources. It also means that crude across the world and especially refined oil products (which China, India, Turkey, South Korea and Japan will be importing in order to tide their economies over) will soar in price. The 2007-2008 banking crisis will instead become a banking AND oil crisis.
Iran itself becomes a battlefield as various countries and non-state actors seek to influence the outcome. Radical Sunni groups are likely to seek to intervene in order to end what they see as Shia heresy, other groups will be intervening to kill and humiliate Americans, still other entities will intervene in order to gain the gratitude of the Iranian government after the US inevitably admits defeat, still others will seek to foster other ideological groups to fight against the invaders in the hopes that after the US withdraws these groups will be strong enough to come to power in Iran. If Iran's military isn't effectively destroyed, intervention against the US will likely occur on their terms, if the military is destroyed, we're looking at something like the Syria mess, but with a much more dominant position for the old regime in the many-sided struggle.
It will be a mess and the US military and the Iranian people will bear the brunt of it.
I'm not sure that this defeat would break the US though. Failing to effectively occupy Iran doesn't say much that the failure to occupy Iraq or Afghanistan does. My bet is that the US just has a debt a few trillion dollars larger, worse relations across Asia, less respect everywhere else in the world, and with a few thousand people fewer due to deaths in Iran. This won't kill the US hegemony, though it will be several more straws on the camel's back.
fasquardon