Image copyright Rogers Jones & Co Image caption This is the second version painted by Vosper

One of the most famous images in Welsh art has been bought by the National Library of Wales.

Painted in 1909, Salem, by Sydney Curnow Vosper, was due to be sold by auction for up to £60,000.

But Rogers Jones & Co Auctioneers said it had been withdrawn from sale, and it was pleased it would remain in Wales' public collection.

The National Library of Wales said it was "proud" of the purchase and would "protect and cherish it forever".

It will be exhibited at the library in Aberystwyth, Ceredigion. The terms of the sale have not been made public.

Meri Huws, vice president of the library, said: "This priceless treasure could have easily been lost by the nation and this would have been a great travesty."

The painting depicts Sian Owen in a shawl entering Capel Salem, Cefn Cymerau in Gwynedd.

The artist has denied the shawl contains an image of the devil in its folds but this did not stop it becoming the painting's main talking point over the years.

Image copyright Rogers Jones & Co Image caption The artist has always denied the devil's face, highlighted here, was depicted in the fold of the shawl

The painting was was one of two versions of the image painted by Vosper.

The first was sold to William Hesketh Lever who used the image for a promotional competition by his Sunlight soap brand.

This second version of the painting, which has minor differences to the first, was painted a year later for the artist's brother-in-law Frank James.

The work was due to be auctioned in Cardiff on 19 October.

In a statement, the fine art auctioneer described the painting as a "fine art icon", adding: "Although we were looking forward to the excitement and potential drama of seeing it being sold at the auction, we are immensely pleased that the painting will now remain in the public collection in Wales."