MOSCOW (AP) — A protest demonstration by at least 20,000 people on the eve of Vladimir Putin’s inauguration as president boiled into a battle with police after protesters tried to split off from the approved venue and march to the Kremlin.

Club-wielding, helmeted officers seized demonstrators and hauled them to police vehicles, dragging some by the hair. Among those arrested were three of the leaders of the opposition movement that gained new life over the winter: Sergei Udaltsov, Alexei Navalny and Boris Nemtsov.

Previous installments of an unprecedented wave of protests that burst out after fraud-plagued parliamentary elections in December were marked by fastidious order. The crowds, sometimes as big as 100,000 or more, carefully kept to agreed-upon meeting-places and routes, even making a point of thanking police who stood guard in vast numbers but did not interfere.

Sunday’s break in that pattern likely reflected a sense of anger and impotence among protesters upset that Mr. Putin was elected handily to a new term in the Kremlin despite their startling defiance.

Mr. Putin — who imposed a political system that stifled dissent and who dismissed the protesters as callow, pampered youths and Western stooges — will be sworn in for a six-year term on Monday.

Sunday’s demonstration started out peacefully, with protesters marching down a wide avenue to a square on an island near the Kremlin, where authorities had approved a gathering of up to 5,000.

But some demonstrators aimed to turn up the pressure by trying to split off and head to the Kremlin, on the other side of the river — and called for the crowd to head for the bridge leading to the Kremlin.

A phalanx of riot police blocked the approach to the bridge. After about an hour of tense confrontation, police began pushing protesters back toward the square and harshly detained some of them. Some demonstrators threw stones at the police — at least four police were seen with injuries — and throat-irritating gas wafted through the air, although it was not clear who had deployed it.

Before the march turned violent, some of the demonstrators acknowledged that Mr. Putin’s March election win and his inauguration have been a blow to morale.

“It’s true that some have been disappointed,” said Yuri Baranov, a 46-year-old information technology specialist, but “the most important thing is that people have awakened.”

Others admitted some doubts about whether the protests would spur any long-term change.

“I would like to think that our voice will be heard, but I am not totally sure of this,” said Yelena Karpsova, 47, who came to the rally from Tula, about 120 miles south of Moscow.

The opposition’s effectiveness is weakened by its own amorphousness — it is a loose alliance of leftists, Western-oriented liberals, nationalists and other factions. Some demonstrators were clearly impatient with the lack of a clear and focused program.

“Create a party, or I’m going to the dacha,” read a poster held by one demonstrator, referring to the summer houses to which Muscovites love to flee.