The oldest surviving fountain in Britain has been restored to its "full glory" in a five-year project.
The fountain will only be turned on for special occasions
The King's Fountain at Linlithgow Palace has had water flowing through it for the first time in a century.
The whole 5m-high structure of the 16th century fountain was completely dismantled and put together again.
Historic Scotland said the fountain looks as impressive as in the days of James V but it will only run with water on "special occasions" to avoid damage.
Doreen Grove, the principal inspector of ancient monuments for Historic Scotland, said: "The whole thing is about demonstrating James V's political power and his international links.
"At the very top of the fountain is a crown and beneath it is a sun, which is trying to indicate that James was close to God."
The fountain, in the courtyard at the palace was commissioned by James V in 1537, possibly to welcome his new French queen.
In 1633 the fountain flowed for a visit by Charles I and it is said that it flowed with wine when Bonnie Prince Charlie visited the palace in 1745.
When the palace burnt down in 1746, the fountain seemed to have suffered because it was a clear symbol of Stewart kingship.
Ms Grove said that the fountain had a long history of needing repair.
She said: "It needed repair as early as 1633, but there was a very major run of repairs in the 1930s which, though well-intentioned, were quite damaging to the stonework.
"It was completely taken apart at that point, rebuilt, and that putting back together actually stopped the water flowing."
The latest repair project began in 2000.
Each of the 158 carved or moulded stones from the fountain was surveyed, photographed and the condition determined.
Many of the new stones for the fountain were carved by Historic Scotland stonemasons at a stone carving facility based at Blackness Castle.
As much as possible of the original material was retained and reinstated during the conservation work.
The reassembling of the fountain included the replacement of three tiered basins along with a crown which sits at the top of the fountain.
The fountain was commissioned nearly 500 years ago
Every detail has been authentically restored so that the fountain now looks as impressive as in the days of James V when it was first built.
It is also now in full working order, although periods of operation will be limited in order to minimize future erosion of the stone.
Ms Grove said: "It will have to be for pretty special occasions, but our aim was to get back that real glory of the fountain.
"As you go into the courtyard at Linlithgow, which is one of the most impressive spaces in Scotland, you were meant to say 'wow'. And you do again now."