A rare manuscript detailing the laws of Hywel Dda is coming home to Wales after being bought at auction for more than half a million pounds.

The laws were drawn up in Whitland by 10th century Welsh ruler Hywel Dda and the manuscript, written in medieval Welsh and featuring coloured decoration, is one of the earliest of its kind ever offered in a public sale.

It was sold at auction in Sotheby’s, London last Tuesday for £541,250 to the National Library of Wales, which received financial support from the Heritage Lottery Fund.

The pocket-sized book would probably have been used by an itinerant judge in south Wales in the 14th century.

Known as the Boston Manuscript, it was auctioned on behalf of Massachusetts Historical Society, which was likely to have been given the manuscript as a gift from Welsh emigrants in the early 19th century.

Dr Manon Williams, chair of the Heritage Lottery Fund’s committee for Wales, said: “The auction was a once-in-alifetime opportunity to bring home one of Wales’ true treasures, and I’m delighted that we were able to act swiftly and provide the required funding to make it happen.”

The manuscript will be housed in the National Library of Wales at Aberystwyth, where it will be studied and interpreted by experts.

The lottery fund’s grant of £467,000 will enable the library to work to conserve and digitise the work to enable it to be viewed on the internet, and to create replicas for display.

There are also plans for an education programme and a touring exhibition.

The manuscript will be available for public viewing at the library between July 23rd and August 10th before conservation work begins.