The court overturned an earlier ruling that Jose Padilla, accused of planning an attack with a "dirty bomb", should either be charged or freed.
A federal judge had ruled earlier this year that Mr Padilla could not be held indefinitely without charge. Lawyers have argued that the president is exceeding his authority by denying him access to lawyers and courts. But the government says such detentions are necessary to prevent terrorism in the US.
Presumably this will go to the Supreme Court eventually. Some time after Bush has appointed two more of his college roommates.