Kiev's Independence Square had the atmosphere of a medieval tent camp preparing for siege on Wednesday evening as thousands of protesters worked in battalions to shovel snow into sandbags and rebuild barricades while the national anthem rang out.

The redoubled effort to secure the square came after an extraordinarily misjudged night-time assault by thousands of riot police, which achieved nothing except to re-energise a protest that had been flagging.

The co-ordinated attack on the barricades around the square in the early hours of Wednesday morning was a determined and unexpected crackdown on protesters who have occupied the centre of Ukraine's capital for the past fortnight. President Viktor Yanukovych has struggled to contain protests since he ducked out of signing an integration agreement with the EU last month.

The EU's top foreign policy official, Catherine Ashton, who visited the square after meeting Yanukovych on Tuesday, expressed outrage at the attempt to clear it.

"I really do condemn the use of force, it's totally unacceptable," said Ashton, who held an emergency meeting with ambassadors of EU countries in Kiev on Wednesday. "Especially when I had a chance to see how people are demonstrating peacefully. I think people of this great country deserve better."

The prime minister, Mykola Azarov, claimed that the police action was simply meant to clear roads. "No force will be applied against peaceful protesters. Do you understand this? Calm down," he said at a government meeting.

But there was condemnation from around the world. Carl Bildt, the Swedish foreign minister, wrote on Twitter: "Eurasia versus Europe in streets of Kiev tonight. Repression versus reform. Power versus people."

The US secretary of state, John Kerry, released a strongly worded statement expressing "disgust" at the government moves, and on Wednesday morning Kerry's deputy, Victoria Nuland, visited Independence Square and handed out biscuits to protesters.

The protests, now in their third week, culminated on Sunday in the biggest demonstration in Ukraine since the 2004 Orange Revolution. Hundreds of thousands of people paralysed the centre of Kiev, and the city's statue of Vladimir Lenin was toppled and hacked to pieces.

A Ukrainian delegation is expected in Brussels on Thursday to discuss renewing negotiations on the integration pact. Azarov said he had asked the EU for €20bn (£17bn) in aid to help Ukraine's economy through the integration process, a figure many times higher than what is likely to be on offer. Russia is believed to have offered aid and cheaper gas if Kiev abstains from signing, and financial woe if Yanukovych does put pen to paper on the deal.

Although Ukraine is split between the Russian-speaking east and the more pro-European west, Yanukovych's corruption-riddled government is unpopular across the country. The EU deal simply provided the lit match sparking broader protests against the government. Independence Square, hub of the Orange Revolution, has become the focal point of discontent, with pitched tents, food stands and a stage blaring out music and revolutionary speeches.

Wednesday's storming of the barricades came in the dead of the coldest night this year as temperatures plummeted to -13C . Shortly after 1am, battalions of police approached the vast square from all sides and began to dismantle the makeshift barricades that had been erected by protesters.

Several officers confirmed they had been given orders to clear barricades from the boundaries of the square but not remove the tent camp that has sprung up inside the space.

The fiercest battle came on the north side of the square, where hundreds of black-helmeted riot police struggled for several hours against lines of protesters wearing orange helmets distributed by organisers, in scenes that threatened to descend into all-out pitched battle.

Many police were trapped behind protester lines during the scuffles, and were saved only by the relative restraint of protesters, who set them free and even handed back their shields, only for police to launch new assaults. Eventually chainsaws were used to clear the barbed-wire-topped wooden barriers and hundreds of riot police moved into the square itself.

The barricades were removed and hundreds of police took up positions on the square as dawn broke. However, they soon disappeared entirely from the city centre, leaving protesters to rebuild the barricades that had been dismantled just hours earlier.

At Kiev city hall, which has been occupied by protesters for 10 days, buses packed with riot police drove up mid-morning on Wednesday prepared to reclaim the building but were repelled by protesters spraying them with water, using fire hoses from first-floor windows. A huge crowd gathered outside taunting the riot police, who remained stuck in their buses for an hour before driving away to joyous chants.

"I am completely sick of this government and this president," said 42-year-old Mykola Levchenko, who on Wednesday evening was helping to put the finishing touches to a new barricade of snow-filled sandbags and metal railings at one entrance to the square. "We are going to stand here until he resigns."

Tension remained high in Kiev throughout Wednesday, and police briefly closed both the city's airports and the main train station after receiving bomb threats. Yanukovych said he was ready to talk with the opposition, but Vitali Klitschko, the former heavyweight boxing champion and one of the main opposition leaders, said that only the president's resignation and snap parliamentary and presidential elections would suffice.

"This was the most stupid thing the authorities could have done," Klitschko told the Guardian early on Wednesday morning. "To clear out the square when Catherine Ashton is in town. People here are determined not to live in a police state."