Talysh: Azerbaijan protest draws 20,000 people
It was the second protest this week, aimed, the opposition says, at sparking a movement like the Orange Revolution that forced regime change in Ukraine.
President Ilham Aliyev, whose New Azerbaijan Party won the election, says he will not allow that to happen.
International observers said the poll did not meet democratic standards.
The protests have been organised by an opposition alliance of the main Azadliq (Freedom) bloc and a number of smaller groups.
The earlier protest, on Wednesday, drew 15,000 people.
Organisers had hoped for a greater turnout on Sunday to spark a campaign like last year's Orange Revolution in which Viktor Yushchenko was swept to power in Ukraine following a re-run of rigged presidential elections.
The protesters in Baku waved orange flags as they marched to Victory Square, directing chants of "resign" to President Aliyev.
Top Azadliq leader, Ali Kerimli, said: "Let no-one think that this struggle will end. We will wage it until the end."
Protester, Ruslan Asadov, 19, said: "We were told not to come here, but we did anyway. We want new elections. Everybody needs to unite for democracy."
About 800 riot police were on duty.
The BBC's Natalia Antelava in Baku says some of the protesters asked the police to join them.
Protest leaders urged the crowd to pursue a peaceful demonstration, at which point thousands sat down and said they wanted to stay in the square beyond the time the march was allotted by authorities.
But the leaders said they should go home to avoid a confrontation and the rally broke up peacefully, our correspondent says.
President Aliyev's party won more than half the seats in the 125-seat parliament.
Internationally-overseen exit polls in a number of districts were at odds with the official results.
But Mr Aliyev has said he will not allow a popular revolt.
"The chances of this happening in Azerbaijan are zero," he said on Saturday.
The president has ordered two re-runs and one recount in constituencies following the poll and has also promised to punish those responsible for fraud.
Observers from the Organisation for Security and Co-operation in Europe, the Council of Europe and the US state department said there was serious fraud - including intimidation, stuffing of ballot boxes and violations in counting procedure.