One of the first medieval manuscripts written in Welsh has been published online after it was bought at auction and returned to Wales from the US.
Its believed the 14th Century book, the Laws of Hywel Dda, was taken to America by Welsh settlers in the 1700s.
When it came up for sale last year the National Library of Wales, Aberystwyth bought it at auction for £541, 250.
The library is delighted this "once-forgotten Welsh treasure" is now on general view.
The book outlines the laws of 10th Century Welsh ruler Hywel Dda (Hywel The Good) who created the country's first uniform legal system.
Few people have seen it and the manuscript's condition had greatly deteriorated since the 18th Century.
When the Massachusetts Historical Society of Boston decided to place it on the market, the library said there was a risk that it would be sold to a private collector, or for breaking up by souvenir hunters.
However, with a grant from the Heritage Lottery Fund (HLF) and assistance from the Friends of the National Libraries and the Welsh government, the institution fought off competition to buy it at the Sotheby's auction last July.
The book went on show in Aberystwyth last summer before it was taken into the care of conservators to be rebound and digitised.
A year later, following what the library called a laborious and careful process of repair, the book of laws is available for website visitors to view.
Manuscript librarian Dr Maredudd ap Huw explained: "During months of intensive study, the manuscript has slowly revealed its secrets, and clearly shows signs of having been added to and adapted during the medieval period, as it was used by law practitioners.
"There are now greater opportunities than ever before for students to explore its contents and history."
Aled Gruffydd Jones, chief executive and librarian of the National Library of Wales, said: "The long-term preservation of the manuscript has now been secured, and we are delighted that visitors to our website will be able to see this once-forgotten Welsh treasure."
Head of the Heritage Lottery Fund in Wales, Jennifer Stewart, said: "The manuscript is one of Wales' true treasures and I'm delighted to see it back home safely in the National Library of Wales."
The newly-repaired and rebound Boston Manuscript itself will make its first public appearance at an exhibition of early Welsh manuscripts at the library on 12 October.