MOSCOW (AP) — An attempt by Vladimir Putin's foes to protest his presidential election victory by occupying a Moscow square ended Monday with riot police quickly dispersing and detaining hundreds of demonstrators — a stark reminder of the challenges faced by Russia's opposition.

The harsh crackdown could fuel opposition anger and bring even bigger protests of Putin's 12 years in power and election to another six, but it also underlined the authorities' readiness to use force to crush such demonstrations.

The rally marked a change of tactics for the opposition, which has been looking for ways to maintain the momentum of its demonstrations that flared in December. Alexei Navalny, a popular blogger and one of the most charismatic protest leaders, was the first to suggest that supporters remain on Moscow's streets and squares to turn up the heat on Putin.

For Putin, the opposition move raised the specter of the 2004 Orange Revolution in Ukraine, where demonstrators camped on Kiev's main square in massive protests that forced officials to throw out a fraud-tainted election victory by the Kremlin-backed candidate.

The government's response Monday night was fast and decisive. Lines of officers in full riot gear marched into tree-lined Pushkin Square and forced protesters into waiting police buses. About 250 people were detained around the city, police said.

The crackdown followed a rally that drew about 20,000 people angry over an election campaign slanted in Putin's favor and reports of widespread violations in Sunday's voting.

Putin commands the loyalty of police and the military, whose wages were recently doubled. Following Monday's massive show of force, the urban middle-class forming the core of the protests could be more reluctant to attend future demonstrations.

Navalny — who sought to electrify the crowd with a passionate call of "We are the power!" — was among those detained, along with opposition leader Sergei Udaltsov. Both were released from police custody a few hours later.

"We are calling for peaceful action of civil disobedience, and we shall not leave," Navalny shouted to the crowd. "We know the truth about this government. This is the government of crooks and thieves."

Upon his release from police custody, Navalny told 30-40 supporters who greeted him that another protest was planned for Saturday in Moscow and other cities.

"We will keep on fighting until we win," he said.

Putin, who was president from 2000-08 and is the current prime minister, won more than 63 percent of the vote, according to the nearly complete official returns, but the opposition alleged massive ballot fraud. Communist Party candidate Gennady Zyuganov finished a distant second with 17 percent.

"The campaign has been unfair, cowardly and treacherous," said opposition leader Grigory Yavlinsky, who was denied registration for the race on a technicality.

International election monitors pointed to the lack of real competition and said the vote count "was assessed negatively" in almost a third of polling stations that observers visited.

"There was no real competition, and abuse of government resources ensured that the ultimate winner of the election was never in doubt," said Tonino Picula, the head of the Organization for Security and Cooperation in Europe observer mission. "Broadcast media was clearly biased in favor of one candidate and did not provide fair coverage of the other candidates."

Russian observers cited numerous reports of "carousel voting," in which busloads of voters were driven around to cast ballots multiple times, as well as other violations. They said the number appeared to be as high as in December's disputed parliamentary vote that kicked off the protests.

The independent Russian elections watchdog Golos said incomplete reports from its observers at individual polling station counts contradicted the official vote count, indicating that Putin was perilously close to the 50-percent mark needed for a first-round victory.

Monday's rally was sanctioned by authorities, but security was tight, with about 12,000 police deployed.

The estimate of about 20,000 people was significantly smaller than previous protests that drew up to 100,000 — perhaps because of the relatively modest size of Pushkin Square. Rally organizers picked the site for its symbolic importance for the nation's democratic movement in the waning days of the Soviet Union and also for its proximity to the Kremlin.

Udaltsov, one of the organizers, urged protesters to stay on the square until Putin stepped down.

"If it was a free election, why have they flooded the entire city with troops?" Udaltsov shouted to the crowd, which responded: "They fear us!"

After the rally ended, Navalny, Udaltsov and other opposition leaders were joined by several hundred protesters who tried to stay on the square, chanting: "We shall not leave!"

Hundreds of riot police surrounded them, but waited more than an hour before breaking it up.

"This is a police state!" a man in his 40s told a friend by cellphone.

An elderly woman added: "This is outrageous!"

Shortly after his arrest, Navalny posted a picture to Twitter of a group of people detained along with him in the same prison van.

"One man in a paddy wagon is calmly smoking an electronic cigarette. One is using his iPad to talk on Skype. One person is reading a book," he wrote in a separate tweet.

Police also rounded up protesters who tried to walk toward the Kremlin.

Some demonstrators grew angry when they saw riot police blocking their way on Tverskaya Street, Moscow's main avenue. A man shouted "Moscow is my city!" and a young woman screamed in fear as police pushed demonstrators back.

Police also detained Eduard Limonov, the leader of the banned National Bolshevik Party, and dozens of his supporters who tried to rally on Lubyanka Square near election commission headquarters. The main KGB successor agency is located on the same square.

In St. Petersburg, about 300 protesters were arrested when about 2,000 people gathered for an unauthorized rally.

Putin's win was assured as he faced a weak slate of Kremlin-approved candidates and many across the country still see him as a guarantor of stability and the defender of a strong Russia against a hostile world, an image he has carefully cultivated.

He has relied on massive coverage by state television, denouncing his foes as Western stooges working to weaken Russia.

Putin claimed victory to a large crowd of supporters outside the Kremlin on Sunday night, before all the votes were counted. His eyes filled with tears, he defiantly proclaimed that they had defeated opponents intent on "destroying Russia's statehood and usurping power."

U.S. Sen. John McCain, who had goaded Putin in the past on Twitter, reacted quickly to the images of Putin's tears with an acerbic tweet: "Dear Vlad, Surprise! Surprise! You won. The Russian people are crying too!"

The protesters on Monday mocked Putin's tears as evidence of his fear of the opposition. "We have seen a man who wasn't sure of himself," said Ilya Yashin, one of the opposition leaders.

"Moscow does not believe in tears," one placard read, a sarcastic play on the title of an Academy Award-winning Russian movie from 1980.

Vladimir Belyayev, a 62-year-old protester, held a sign that said, "People, where is your self-dignity?"

"I have nothing to fear," he said.

Mikhail Kasyanov, who served as prime minister during Putin's first term before becoming an opposition leader, urged protesters to focus on demanding a rerun of the fraud-tainted parliamentary election in December, which allowed Putin's party to retain its majority in the lower house.

In an apparent bid to assuage the opposition anger, outgoing President Dmitry Medvedev told the Justice Ministry to present its explanation for last year's rejection of registration for the People's Freedom Party, an organization led by some of the opposition's most prominent figures.

In another apparent attempt to soothe protesters. Medvedev also ordered the prosecutor-general to re-examine the legality of the conviction of imprisoned former oil tycoon Mikhail Khodorkovsky and more than 30 others regarded by the opposition as political prisoners.

The Obama administration congratulated the Russian people for turning out to vote in big numbers in Sunday's election, but it also expressed concern about allegations of fraud and urged a full investigation into the charges.

The State Department said the U.S. would work with Russia's "president-elect" once the votes are certified, but pointedly did not mention Putin by name or congratulate him.

U.S. Ambassador Michael McFaul voiced concern about Monday's crackdown, tweeting: "Troubling to watch arrests of peaceful demonstrators at Pushkin square. Freedom of assembly and freedom of speech are universal values."