Thousands of demonstrators Saturday poured into Barcelona ahead of a planned mass anti-globalization rally as European leaders wrapped a summit on economic reforms.

Police said 29 people had been detained so far during the two-day meeting, including five in clashes with police overnight.

Among the detainees were five foreigners from Sweden, Germany, Belgium, Slovenia and Britain, a police spokesman said.

Protest leaders said authorities were refusing entry into Barcelona of busloads of demonstrators from around Europe and the Basque region of northern Spain.

Newspapers reported clashes on the border, about 130 kilometers (75 miles) north of Barcelona, as police tried to prevent entry to demonstrators.

Spain has reinstated border controls previously scrapped under European Union treaties.

Authorities have said they would turn back anyone suspected of planning to instigate violence.

On Friday, police fired rubber bullets and clubbed several dozen protesters who threw rocks and garbage cans and rampaged through downtown Barcelona as leaders of 28 nations met in a heavily guarded compound outside the city.

No major injuries were reported.

Organizers estimated between 20,000 to 50,000 demonstrators are swarming into Barcelona to protest EU leaders' plans to liberalize energy and financial markets.

A major demonstration has been called for Saturday evening by the umbrella organization of protest groups, the Campaign Against a Europe of Capitalism and War.

Friday night, hundreds of young people gathered for a candlelight memorial for Carlo Giuliani, a 23-year-old protester shot and killed by police at a summit last summer in Genoa, Italy. On a wall, a demonstrator spray painted: "An eye for an eye; a tooth for a tooth."

At the Palacio de Congresos, EU leaders are expected to sign off on new pledges to cut red tape and boost Europe's floundering economies Saturday, including opening up energy markets.

Security measures around the city include the deployment of 8,500 officers, as well as combat jets and ground-to-air missiles and warships off the coast.

Nato has also sent a surveillance jet to provide early alert against a possible terrorist attack from the air.