The order to release Emin Milli today came after a court approved the early release of blogger Adnan Hajizade on November 18.
The two were convicted of hooliganism in November 2009 for a fight authorities said they started in a restaurant in Baku in July 2009. Hajizade was sentenced to two years in prison, Milli was jailed for 2 and 1/2 years.
Both said the conviction was a pretext to punish them for political dissent. Media freedom groups and foreign officials also raised concerns about the jailing of the bloggers -- who were arrested after satirizing the government with an Internet video that showed a donkey giving a press conference.
Hajizada looked both elated and baffled as walked out of the courtroom a free man on November 18.
"When I heard today that the prosecutor is not against my release, I couldn't believe what I was hearing," Hajizada said.
"In the last 17 months I've had about 12 different trials, and the processes and decisions were never fair. So I thought it was some kind of mistake."
Despite welcoming the decision, Hajizada said his release from prison was not enough.
"I'm not a criminal in the first place and I behaved well in prison, so I think this is justified," Hajizada said. "But I want to get a full acquittal, because I'm not a hooligan."
The two men's jailing was widely seen as retribution for their satirical Internet video in which Hajizada holds a fake government press conference dressed as a donkey.
The video clip -- which earned Hajizada and Milli the nickname "donkey bloggers" -- is likely to have angered President Ilham Aliyev and his entourage, which have grown increasingly intolerant of public criticism in recent years.
The case had prompted criticism from media-freedom groups and foreign officials. In September, U.S. President Barack Obama called for the men's release during a meeting with Aliyev.
Lucie Morillon, a spokeswoman for the Paris-based media-freedom group Reporters Without Borders, said international pressure had grown uncomfortably strong for Azerbaijan's authorities.
"Keeping them in jail had become a liability for the government. I think they decided to release Adnan as a sort of goodwill gesture for the international community, and it was easier to do it now than before the elections," Morillon said.
The Organization for Security and Cooperation in Europe (OSCE) was also quick to welcome Hajizada's release and voiced hope it would be followed by the freeing of Milli and Fatullayev.
The OSCE's representative on freedom of the media, Dunja Mijatovic, urged authorities in Baku to "decriminalize defamation so that journalists can exercise their profession free without fear of imprisonment no matter how provocative, satirical, or sensitive their expressed views are."
The decision to free Hajizada comes less than two weeks after parliamentary elections in Azerbaijan that gave the ruling party and its allies a sweeping victory.
David Kramer, the head of the U.S.-based democracy watchdog Freedom House, sees his release as an attempt to dampen international criticism of the November 7 poll, which observers said was marred by severe violations.
"This is coming against the backdrop of some criticism that Azerbaijan has been facing, including from Europe's top human rights court, [and] some criticism about the parliamentary elections," Kramer said. "Maybe this is a way to try to deflect some of that criticism."
Azerbaijan has refused to free prominent journalist Fatullayev despite a European Court of Human Rights ruling demanding that Baku immediately release him and pay him 25,000 euros ($33,500) in moral damages.
The country's Supreme Court last week lifted some charges against Fatullayev. But he remains imprisoned on drug-possession charges brought while he was in prison and that he claims are fabricated.