Presiding Judge Anatoly Yarema said the rerun should be held by Dec. 26.
The short timeframe set for a new vote appeared to rule out the possibility of holding an entirely new election, as sought by outgoing President Leonid Kuchma.
The court issued its verdict in response to an appeal by opposition leader Viktor Yushchenko, who asked the court to cancel results of the Nov. 21 runoff, which he said had been rigged in favor of Prime Minister Viktor Yanukovych.
Tens of thousands of opposition protesters who had massed in Kiev in anticipation of the decision cheered, waving blue-and-yellow Ukrainian and orange Yushchenko flags and chanting "Yushchenko! Yushchenko!" The crackle of fireworks could be heard in the distance.
Yushchenko's lawyers in court were jubilant.
"This is a great victory of all people who have been standing at the square, a great victory for Ukrainian democracy," said Mykola Katerinchuk, the Yushchenko lawyer who wrote the appeal.
Another Yushchenko ally, Yuri Klyuchkovsky, called the verdict a "historic decision that opens the way for a fair solution to the crisis."
Representatives from Yanukovych and the Central Election Commission left the courthouse before the judges announced their decision.
The runoff had triggered a massive political crisis, with Yushchenko supporters maintaining a round-the clock vigil in the capital for the 12th day Friday and laying siege to official buildings.
The crisis has strained relations between Russia, which has staunchly backed Yanukovych, and the West, which has refused to accept the official results.
Kuchma, the outgoing Ukrainian president, traveled to Moscow on Thursday for a meeting with Russian President Vladimir Putin, who told him that a new vote would be pointless.
"A revote could be conducted a third, a fourth, 25th time, until one side gets the results it needs," Putin said sarcastically in televised comments from a Moscow airport.
In Kiev, Yushchenko criticized Kuchma's trip to Russia, saying, "the source of power is located in Ukraine – it's the Ukrainian people."
President Bush said Thursday that any new election in Ukraine should be free from outside interference – a statement aimed directly at Russia.
The State Department, however, rejected any suggestion of sharp U.S.-Russian disagreements over Ukraine.
Spokesman Richard Boucher said the United States and Russia support a Ukrainian process now under way "to find an outcome that can reflect the will of the Ukrainian people."