By Luiza Ilie and Christian Lowe

BUCHAREST (Reuters) - Romania's top court ruled in favor of a law to kill tens of thousands of stray dogs from the streets of Bucharest on Wednesday after a four-year-old boy was mauled to death earlier this month.

The boy's death triggered street protests demanding action against the capital's more than 60,000 strays, who bite dozens of people every day and are also a deterrent for tourism.

Parliament overwhelmingly backed a law that allows local administrations to put down dogs caught in public spaces if they are not adopted within two weeks. Animal rights groups, however, have protested for the dogs to be saved and a group of lawmakers challenged the law in the Constitutional Court.

Prime Minister Victor Ponta welcomed the court's ruling in favor of the law on Wednesday.

"You cannot postpone a decision between a kid's life and a dog's life," he told Reuters. "It is very clear that the decision should be to protect people's life."

Hundreds of animal rights' protesters gathered outside the court to protest, chanting "May you get the dogs' fate" and carrying banners that said "Red card for Romania", "Choose life" and "We are not a criminal nation." Protests were set to continue.

"We will consult lawyers and if possible ... we will attack the decision at the international level," said Kuki Barbuceanu, project coordinator for the local unit of Vier Pfoten, an animal welfare organization.

In previous failed campaigns to cull the strays local and international animal rights groups have argued that sterilization and adoption were the solution.

Ponta said he hoped that local authorities would look at adoption or finding shelter for the dogs first, and use the option to kill them "very rarely".

Strays are thought to be a legacy of late communist dictator Nicolae Ceausescu's decision to bulldoze pre-World War Two houses in Bucharest's historic center in the 1980s to make way for the parliament building, one of the largest in the world.

In the process, thousands of guard dogs were abandoned by residents who had been forcibly relocated into small apartments.

In 2006, a 68-year-old Japanese businessman bled to death in central Bucharest after a stray dog bit him in the leg. Two years ago, a woman in her 50s died of multiple wounds after being attacked by a pack of dogs.

(Editing by Susan Fenton)