Thousands came to say their last goodbye to Elmar Huseynov, one of Azerbaijan's best-known and most radical journalists.
By Natalia Antelava
BBC News, Baku
Mr Huseyinov's family had asked the opposition not to turn the funeral into an anti-government rally, as had been originally planned.
The journalist's family have asked not to turn the funeral into a rally
Still, Friday's ceremony inside the main hall at Baku's Academy of Sciences resembled a political meeting rather then a funeral.
There were tears, but there were also plenty of angry statements.
As a government official stood up to speak. the crowd jeered and shouted until he was forced to leave the room.
People waved slogans condemning the lack of freedom of the press in Azerbaijan.
"It's very nice and profitable to be a journalist in Azerbaijan if you work for the state media," an independent journalist Rustam Seyidov told the BBC.
"But if you want to tell the truth, if you want to speak up, then you are prosecuted. You get thrown into jail. You are beaten. And as we just saw - you may even get killed," Mr Seyidov said.
Among those who addressed the crowd of mourners on Friday was the US Ambassador to Azerbaijan Reno Harnish.
"Journalists are a great asset to democracy. And democracy must come to Azerbaijan," Ambassador Harnish said.
Many of those who came to say their last farewell to Elmar Huseynov on Friday said that this death showed them once again just what a long way their country is from democracy.
Mr Huseynov was killed by four bullets fired straight into his chest as he entered the building where he lived on Wednesday night.
Residents in the block of flats say that electricity went off and phones stopped working in the building at the time of the murder, leading many here to believe this was a well-prepared attack.
Mr Huseynov's magazine was among the most popular and outspoken anti-government publications in Azerbaijan. Several officials here have sued Mr Huseynov for defamation in the past, and about a year ago the government banned his magazine.
Dozens of people applauded as the opposition leader Ali Keremli addressed the crowd at the funeral, saying that the government should resign unless it can track down the killers within the next two weeks.
Many people think the assassins will not be found
Mr Keremli told the BBC that next week the opposition plans to hold mass rallies.
This is the year of the parliamentary election for Azerbaijan and many here wonder whether Mr Huseynov's murder will push for the change.
"I hope this murder will become for Azerbaijan what Gongadze's case was for Ukraine. It is time for us to stand up for our rights," said 43-year-old Farida. She chose not to give her full name.
But analysts say any sort of a popular uprising is unlikely in the country where rights of free assembly are limited and the opposition is weak and divided.
As the funeral procession moved towards the cemetery, Azerbaijan's late president, the grey-headed Heydar Aliyev, watched the crowds from the numerous billboards.
"Where have you seen a country ruled by a dead man?" one of the mourners muttered.
Mr Aliyev died in 2003 but his presence remained to be strong as ever.
Schools and hospitals are named after him, his portraits hang in the government offices and in the streets, billboards with quotes from his speeches decorate Azerbaijan's roadsides, and his son Ilham is now running this oil-rich nation.
Ilham Aliyev became the president just before Heydar Aliyev was announced dead in October 2003.
Ever since then Azerbaijan's poor human rights record has deteriorated further.
Assaults on journalists and opposition members are common and dozens of people are still in jail for taking part in anti-government rallies that took place after the disputed presidential election in October 2003.
President Ilham Aliyev has asked the United States to help with the investigation of Mr Huseynov's murder, and Washington sent FBI agents to Baku on Friday.
But many of those who attended the funeral said they did not believe the real perpetrators of the attack will ever be found.