Plans to turn the old Royal High School building in Edinburgh into a luxury hotel have been rejected.
The decision was reached after more than seven hours of debate at the city chambers.
The A-listed building, which overlooks the capital from Calton Hill, was built by Thomas Hamilton in 1829 but has been largely unused for decades.
Developers had planned a £75m "world-class" five-star hotel after submitting an application to the city council.
Council planning officials recommended rejecting the proposals on the basis they would damage the heritage of a sensitive site.
Councillors have now backed that view.
The plan to convert Hamilton's neo-classical masterpiece into a hotel was led by Duddingston House Properties (DHP) and Urbanist Hotels.
William Gray Muir, chairman of the Royal High School Preservation Trust, said: "The council's decision today makes it possible for us to pursue our proposals to return the former Royal High School building to its rightful position at the cultural heart of Edinburgh with public performance spaces and a state-of-the-art new home for St Mary's Music School.
"The Royal High School is an iconic building and a unique location and we are delighted that the council has acknowledged its important place in Edinburgh's illustrious heritage."
John Donnelly, chief executive of Marketing Edinburgh, said: "With all planning applications, there is an enormous responsibility. I know the City of Edinburgh Council, working alongside Historic Scotland and Edinburgh World Heritage, is acutely aware of its significance, and today's considered decision was not taken lightly.
"As head of the organisation tasked with promoting Edinburgh as a world leading city to visit, invest, live, work and study, I passionately believe a peaceful and symbiotic relationship between Edinburgh's World Heritage status and future developments can be found in order for our city to grow and succeed.
"As a global destination, Edinburgh will continue to build on our existing assets and there's no escaping that the city is in critical need of new large-scale luxury five star hotels to meet demand from leisure and business visitors, especially from China and North America."
He added: "We, as a city, will move forward and agree a future solution that lets Edinburgh embrace change and innovation, while celebrating our rich, vibrant heritage. We can have the best of both worlds."
Hotel brand Rosewood Hotels and Resorts has been selected to manage the Calton Hill property.
Edinburgh City Council, which owns the Category A building, granted DHP a 125-year conditional ground lease after the company won an open competition in 2010.
The Old Royal High School was vacated in 1968 when the school moved to Barnton.
During the 1970s it was proposed as the site to house a devolved Scottish Assembly.
However, the 1979 devolution referendum did not result in an assembly and when the Scottish Parliament was finally set up in 1999 a new site was chosen.