Feeding the blazing defenses with blankets, tires, wood, sheets of plastic foam and anything else that might burn, the protesters hoped to prolong, for a while longer at least, a tumultuous protest movement against President Viktor F. Yanukovych, a leader who was democratically elected in 2010 but is widely reviled here as corrupt and authoritarian.
“It is called the tactic of scorched earth,” said a protester who identified himself as Andriy.
The police reported earlier in the day that at least nine people, including two police officers, had been killed, but then raised this to 21, making it by far the worst day of violence in more than two months of protests and, for most Ukrainians, the bloodiest in living memory.
The final death toll appears certain to be higher.
Doctors and nurses treating protesters in a temporary medical center in the Trade Union Building on Independence Square reported a number of gunshot wounds and also evidence that the police had doctored percussion grenades in order to inflict more serious injury.
By early Wednesday, the union building had caught fire and the blaze raged out of control, with flames spreading to adjacent buildings.
With the center of the city engulfed in thick, acrid smoke and filled with the deafening din of the grenades, fireworks and the occasional round of gunfire, what began as a peaceful protest in late November against Mr. Yanukovych’s decision to spurn a trade deal with Europe and tilt toward Russia on Tuesday became a pyre of violent chaos.
The violence, which will resonate for weeks, months or even years around this fragile and bitterly divided former Soviet republic of 46 million, exposed the impotence, in this dispute, of the United States and also the European Union, which had engaged in a week of fruitless efforts to mediate a peaceful settlement.
It also shredded doubts about the influential reach of Russia, which had portrayed the protesters as American-backed “terrorists” and, in thinly coded messages from the Kremlin, urged Mr. Yanukovych to crack down.
The White House spokesman, Jay Carney, said the United States was appalled by the violence and urged Mr. Yanukovych to resume dialogue with the opposition.
“Force will not resolve the crisis,” he said in a news briefing.
Vice President Joseph R. Biden Jr. telephoned Mr. Yanukovych to “express grave concern regarding the crisis on the streets” of Kiev, and urged him “to pull back government forces and to exercise maximum restraint,” the vice president’s office said in a statement.
Mr. Yanukovych had repeatedly pledged not to use force to disperse protesters, but after meeting President Vladimir V. Putin of Russia at the opening of the Winter Olympics in Sochi, he had clearly changed his mind.
The fighting also broke out a day after Russia threw a new financial lifeline to Mr. Yanukovych’s government by buying $2 billion in Ukrainian government bonds.
The Russian aid appeared to signal confidence that important votes in Parliament expected this week, to amend the Constitution and form a new cabinet, will go in Russia’s favor.
The fateful shift in Mr. Yanukovych’s thinking and tactics will silence what had been chants night and day from Independence Square for him to resign, but will by no means guarantee his future grip on power in a country that, despite its deep divisions rooted in language and culture, and also huge disparities of wealth, prides itself on avoiding violence.
Even one of the president’s most stalwart supporters, the billionaire businessman Rihat Akhmetov, Ukraine’s richest man, seemed distressed by the president’s decision, warning in a statement on Tuesday that “there are no situations whatsoever that vindicate the use of force against a peaceful population.”
With opposition politicians and other protest leaders vowing defiance late into the night from a stage at the center of their crumbling encampment, it was unclear how long even the greatly feared and detested anti-riot police, known as Berkut, could hang on to Independence Square in the event that residents poured into the area once morning broke.
The authorities shut down the subway system on Tuesday to prevent people reaching the area and said they would restrict traffic into the city starting at midnight.
Activists in the west of the country, a bastion of support for the antigovernment cause, had earlier vowed to send buses with reinforcements to Kiev.
The attack on Independence Square began shortly before 8 p.m., when police officers tried to drive two armored personnel carriers through stone-reinforced barriers outside the Khreshchatyk Hotel on the road to the square.
The vehicles became bogged down and, set upon by protesters wielding rocks and fireworks, burst into flames, trapping the security officers inside one of them and prompting desperate rescue efforts to save those caught in the second vehicle, which managed to pull back from the protesters’ barricade.
A phalanx of riot police officers, backed by a water cannon, had more success in a separate thrust, pushing through protesters’ barricades near the Ukraina Hotel and firing tear gas as they advanced toward the center of the square.
People covered in blood staggered to the protesters’ medical center.
Volodomyr Pogorily, a doctor at the center, said he had removed five bullets from wounded protesters.
Many of the injuries were from percussion grenades, which create a deafening noise but are not meant to be lethal or cause serious injury.
But a nurse said the wounds she had treated during the day suggested that the grenades had been wrapped in tape with nails and stones to make them more dangerous.
Other victims had been hit by birdshot from shotguns.
Yevgeny Avramchuk, a protester who was treated at the center, said doctors had removed a pebble from a hole in his calf.
Another person was evacuated in an ambulance with a chest puncture wound.
Throughout the evening, doctors rushed along a corridor lined with a filthy carpet and littered with bloody bandages, removing projectiles from people slumped in the hallway.
In the late evening, police finally overcame resistance from barricades near the Khreshchatyk Hotel and joined colleagues in a pincer operation to try to secure the flame-encircled center of Independence Square, known as Maidan.
As they advanced, protesters started singing the Ukrainian national anthem.
Arseniy P. Yatseniuk, a prominent opposition leader who had just returned from a meeting on Monday with the German chancellor, Angela Merkel, delivered what could be his final speech from the stage in Independence Square, at least for some time.
“We see that this regime started shooting at people again. They want to drown Ukraine in blood,” he shouted.
“We won’t react on a single one of their provocations. But we won’t make any single step back from here, from this Maidan.”
By early Wednesday, the speeches from the stage gave way to mournful prayers and chants by priests from the Ukrainian Orthodox Church.
Some protesters acknowledged that they had contributed to the violent spiral of events by attacking police officers during street battles early in the day near the Ukrainian Parliament, which the opposition had hoped would approve constitutional amendments curbing President Yanukovych’s powers.
“We have no other way,” said Lena Melniko, a 33-year-old accountant who joined a team of protesters digging up paving stones and passing them on to fighters to throw at the police.
“We have been protesting for three months but are stuck in dead end.”
Throughout the day, opposition leaders urged protesters to stand firm in a series of defiant speeches.
“We will come out of Maidan either free or slaves. But we don’t want to be slaves,” said Serhiy Sobolev, a member of Parliament from the Batkivshchyna Party.
Elderly women clustered on the sidewalk, heedless of the explosions and gunshots, and heckled the police, yelling, “Killers!” and “Shoot us! Just shoot us, kill us, kill us, you bastards!”
Petro Poroshenko, a wealthy opposition member of Parliament whose television station has been broadcasting the protests, called for discipline and defiance.
“We are here not simply protecting Maidan, we are here protecting Ukraine,” Mr. Poroshenko said, urging residents to converge on the square in support.
“We are not simply staying here for the future of Kiev. We are standing for the unity of Ukraine. We are standing for the integrity of Ukraine.”