QUEUES of frustrated foreigners crowd many an American consulate around the world hoping to get into the United States. Less noticed are the heavily taxed American expatriates wanting to get out—by renouncing their citizenship.

In Hong Kong just now, they cannot. “Please note that this office cannot accept renunciation applications at this time,” the consulate's website states. Apart from sounding like East Germany before the fall of the Berlin Wall, the closure is unfortunately timed. Because of pending legislation on President Bush's desk that is expected to become law by June 16th, any American who wants to surrender his passport has only a few days to do so before facing an enormous penalty.

That penalty is buried in an innocuous piece of legislation with the veto-proof name, Heroes Earnings Assistance and Relief Tax (HEART) act. The new law means active American soldiers will benefit from tax relief. To pay for that, Congress has turned on expats, especially those who, since new tax laws in 2006, have become increasingly eager to give up their citizenship to escape the taxman.

Under the proposed legislation, expatriates surrendering their citizenship with a net worth of $2m or more, or a high income, will have to act as if they have sold all their worldwide assets at a fair market price. If the unrealised gains on these assets exceed $600,000, capital-gains tax will apply. A study by the Congressional Budget Office guesses that the new law will progressively net the government up to $286m over five years. It is unclear, however, why people would suffer the consequences if they did not expect to save money in the long run by escaping American taxes.

That expats want to leave at all is evidence of America's odd tax system. Along with citizens of North Korea and a few other countries, Americans are taxed based on their citizenship, rather than where they live. So they usually pay twice—to their host country and the Internal Revenue Service. As this makes citizenship less palatable, Congress has erected large barriers to stop them jumping ship. In 1996 it forced people who renounced citizenship to continue paying income taxes for an extra ten years. Theoretically, the new law allows for a cleaner break.

But even as the law tries to prevent people from renouncing their citizenship, it may have the opposite effect. Under the new structure, it would make financial sense for any young American working overseas with a promising career to renounce his citizenship as early as possible, before his assets accumulate. For everyone else, plunging stock and property prices mean now may be as good a time as any to hand back the passport, says Kurt Rademacher, a partner at Withers, a global tax-planning firm.

In Hong Kong the temptation for Americans to switch citizenship is particularly strong, because of the territory's low taxes. On the other hand, banks and other firms who want to hire Americans may find it harder to do so, even though greater China is one of the world's fastest-growing regions. It places Americans in the awkward position of weighing their patriotism against their vocation.