Foreign diplomats get great parking spots, but their home countries can't escape the U.S. tax man.

A federal judge has ordered the governments of India, Mongolia and the Philippines to pony up $57.6 million in real estate taxes in a case that reached the U.S. Supreme Court.

U.S. District Court Judge Jed S. Rakoff issued the order Monday after the high court ruled 7-2 last year that the city had a right to collect taxes on portions of buildings used by other countries for non-diplomatic purposes.

International treaties have defined consulates and embassies as sovereign territory, which makes them generally tax exempt. But Rakoff said it was clearly stated that only the home of the head of a mission is exempted from taxes in the Vienna Convention on Consular Relations and the Vienna Convention on Diplomatic Relations.

India was ordered to pay $42.4 million in taxes related to a 26-story tower near the United Nations with 20 floors of apartments occupied by diplomatic employees. Mongolia must pay $4.3 million for a six-story building with two floors of staff residences. The tax bill for the Philippines is $10.9 million for a building on a prime stretch of Fifth Avenue that includes commercial tenants.

Robert A. Kandel, a lawyer who represented the three nations in court, did not immediately return a telephone message for comment.

The city praised Rakoff's decision. "We are very pleased that the rule of law was upheld," New York Corporation Counsel Michael A. Cardozo said in a statement. "Most countries are good neighbors to New York City. They pay what they owe, like all other New Yorkers who carry their share of the tax burden. However, this ruling sends a message to those trying to avert their obligations that New York City will be vigilant."