BELGRADE (Reuters) - Scores of protesters smashed their way into the U.S. embassy in Belgrade on Thursday in anger at Kosovo’s independence, ransacking rooms and setting fires before riot police dispersed the crowd.

Protesters wave Serbian flags during a mass protest rally against Kosovo's declaration of independence in Belgrade February 21, 2008. REUTERS/Oleg Popov

Police, nowhere to be seen earlier as the building was attacked, moved in half an hour later, firing teargas and beating and detaining rioters.

Local media said more than 30 people were injured, half of them police, and taken to hospital.

Police in armored vans secured the streets and tried to cordon off the whole embassy district. Local agencies reported attacks on missions of several other countries, among them Britain, Croatia, Bosnia and Turkey.

People tried to flee clouds of painful teargas. Police helicopters flew over the area.

Serbian President Boris Tadic urged rioters to stop.

“I appeal to our citizens to protest calmly. All those who take part in the unrest I want to withdraw from the streets and stop attacking foreign embassies,” he said on a visit to Romania, according to Beta news agency.

Slideshow ( 12 images )

“This only keeps Kosovo distant from Serbia.”

The storming of the U.S. embassy, which had been closed and boarded up after rioters stoned it earlier in the week, came during a state-backed rally to protest at Kosovo’s secession on Sunday attended by some 200,000 people.

Rioters -- many wearing balaclavas and scarves to hide their faces -- had attacked the building with sticks and metal bars after destroying two guard boxes outside.

They ripped metal grilles from windows and tore a handrail off the entrance to use as a battering ram and gain entry.

One man climbed up to the first floor, ripped the Stars and Stripes off its pole and briefly put up a Serbian flag.

Other people jumped up and down on the balcony, holding up a Serbian flag as the crowd below of about 1,000 people cheered them on, shouting “Serbia, Serbia”.

Black smoke billowed out of the embassy. Papers and chairs were thrown out of the windows, with doors wedged in the window frames and burning.

Some 200 riot police arrived half an hour later, driving the crowd away. Some protesters sat on the ground, bleeding. Fire engines arrived to put out the flames, local media reported.

Meanwhile, the main rally proceeded as planned with a march to the city’s biggest Orthodox cathedral for a prayer service, just several hundred meters (yards) away.

State television switched between scenes of the rioting and the choral singing of the church service.

News agencies said some foreign banks and McDonalds fast-food stores were also attacked and eight city buses damaged.