This week marks 20 years since the official opening of the Scottish Parliament building at Holyrood.
It was controversial from the very start. The home originally earmarked for the new legislature - at the old Royal High School - was vetoed; public debate over the location of a new building focused on rival proposals for Leith or Calton Hill, but then Holyrood emerged as the favoured site at the last minute; a competition to choose an architect for the project was won by Catalan Enric Miralles; but when the project began it as still not clear what space and accommodation the parliament would really need, so the requirements kept changing.
The first estimate of the cost of a new building - before either the site or a design had been agreed - was between £10m and £40m. And it was going to be ready by 2001.
The final cost ended up at £414m and the building was officially opened by the Queen on October 9, 2004, with hundreds of workers on site until the day before, putting finishing touches to the project.
Here’s a look back at how the building, now such a familiar sight, came into being.

1. Scottish Parliament building takes shape
After Labour's general election victory in May 1997, a referendum on devolution was held in September that year with a decisive vote in favour of a Scottish Parliament. Edinburgh's old Royal High School (in the background of the photograph) had been reserved to house the new parliament, but instead the site of a former brewery at the foot of the Royal Mile was chosen as the location for a new parliament building. | TSPL Photo: Bill Henry

2. Old Royal High School 'no longer suitable'
When a Scottish Assembly was proposed in 1979, its home was going to be the old Royal High School at Calton Hill, but the referendum on the Assembly failed to meet the required majority. However, the building remained a symbol of the aspiration for a new legislature and it was long assumed that's where the Scottish Parliament would meet. But Scottish Secretary Donald Dewar wanted a new building for a new parliament. He said the old school was no longer suitable. | TSPL Photo: Ian Georgeson

3. Old Royal High School had been converted in 1970s
Inside, the old school had been converted ready for the never-to-be Scottish Assembly - complete with debating chamber. It was used for occasional meetings of the Commons' Scottish Grand Committee - made up of all Scottish MPs - which would debate, but not vote on, Bills before Westminster which applied only to Scotland. But despite the original intention, no parliament would meet here. | TSPL Photo: Bill Stout

4. Holyrood chosen as site for Scottish Parliament
A variety of sites were considered for the new parliament, but the two main contenders appeared to be a waterfront location in Leith, close to the civil servants at Victoria Quay and a Calton Hill scheme, which could have meant creating a chamber within St Andrew's House or a stand-alone chamber building in Regent Road. There was also a proposal for Haymarket. But in the end, the site chosen was the former Scottish & Newcastle brewery headquarters in Holyrood Road, opposite the Palace of Holyroodhouse. Donald Dewar announced the decision in January 1998. | TSPL