"It is the symbol of our strength to overcome the past and our hope for a better future," Sarajevo's mayor Ivo Komsic said at the opening ceremony after the sounds of Beethoven's "Ode to Joy."
In August 1992, Bosnian Serb gunners, who kept Sarajevo under a three-and-a-half-year long siege, targeted the library, built in 1896 in a pseudo-Moorish style, almost burning it to the ground.
The reconstruction work began in 1996, with the European Union investing nine ($12.3 million) of the 12 million euros needed to restore the building.
"Dear Sarajevans, the library has been reborn from its ashes," said top international official in Bosnia Valentin Inzko .
And Bakir Izetbegovic, the Muslim member of Bosnia's joint presidency, hailed a "triumph of civilisation over barbarism."
"Today, on May 9, Europe's day and the anniversary of victory over fascism, we have returned a real architectural and historic jewel to the citizens of Sarajevo and Bosnia," he said.
Izetbegovic paid tribute to "those who did not survive the war, 11,541 citizens of Sarajevo killed during the longest siege in modern Europe."
More than 100,000 people, mostly Muslims, were killed during the inter-ethnic war in Bosnia.
The building, converted into a library in 1949, housed some two million books, old scripts and photographs, many of them rare documents of life in Bosnia under the Ottoman and Austro-Hungarian rule.
But only 300,000 books were spared from the flames.
After the end of the war, the building became a seat of the municipal administration. Now, it will house the library, city council and a museum.