There is something strangely beautiful and haunting about Bangour Village.

A sprawling collection of old buildings in rural West Lothian, for more than a decade its imposing villas have been at war with the elements.

Once a thriving hospital catering for the vulnerable, when the last patients moved out, ivy trailed in.

Over the last few years it has fought with the land it was built on and so far it seems the land is winning.

Built in the 1900s, it had its own church, railway and shop - remnants of which can be seen today.

The church still stands, pews intact, with padlocked gates. The railway line is overgrown with moss and the shop lies boarded up with the word "danger" branded on its walls.

Crumbling and clad with vegetation, the entire village has lain derelict for 13 years.

Now though, property consultants have been instructed to find a buyer willing to take it on.

Still under the guardianship of the NHS, it is currently on the market to be sold off as a housing development.

Originally a psychiatric hospital under the name Edinburgh District Asylum, Bangour Village Hospital officially opened in October 1906 to cater for the "lunatic poor" - more than two years after the first patients arrived in June 1904.

In its prime, it was a ground-breaking facility, designed by one of the nation's top architects, Hippolyte Jean Blancto, known for his Gothic revival-style churches.

The villas are built in a 17th-century Scots Renaissance style while at the centre of the site is a Baroque hall and a Romanesque-style church, designed by H.O. Tarbolton.

Modelled on the Alt-Scherbitz asylum in the Germany town of Schkeuditz, it was one of the first village-plan psychiatric units in Scotland.

At the time, the hospital's approach to patient care was revolutionary.

The Victorian era had been grim for those caught up in the tough regime of asylums.

Large Victorian public asylums haunt the history of psychiatry. In their earliest forms, artefacts show that patients were physically restrained with leg-irons and manacles.

In the first half of the 1900s, asylums became testing grounds for controversial treatments such as electroconvulsive therapy (ECT) and lobotomy.

These methods helped some patients function again but they irreparably harmed others.

For the wealthy, life inside could be more comfortable, though according to documents released to the public in 2013 even those with a considerable degree of money were admitted against their will.

Hundreds of letters from patients at the Royal Edinburgh Hospital were analysed. One letter, from 23-year-old law student James B, is typical.

He wrote: "I have just realised I am actually in a lunatic asylum. Who on Earth ordered the coachman to drive me here?"

Records made public in the Highland Archive Centre showed details of hundreds of patients whose cause of admission ranged from "disappointment in marriage" to losing a Highland Games competition.

Bangour, however, provided gentle care in a sprawling open village complex complete with working farm, large church, shop and bakery.

There were workshops for patients to learn and practice skills, areas for women patients to perfect needlework and embroidery, and even a recreation hall for social gathering.

Doctors advocated a policy of self-sufficiency, with patients encouraged to live and work together in communities.

There were few physical restrictions and patients even produced their own food under the close care of dedicated nursing and medical staff, most of whom lived alongside them.

Each villa housed around 30 residents and by the end of 1905, the site was caring for around 200 patients.

Passengers would travel along the private mile-and-a-half-long railway line on board the Wee Bangour Express to make appointments or meet their friends and family being treated there.

Two world wars, however, would change the work undertaken in its wards.

As Scotland joined the war effort and the battalions went off to fight, the war wounded were brought back to Bangour for care.

It was commissioned by the War Office during both wars to become the Edinburgh War Hospital and the Scottish Emergency Medical Hospital.

In the First World War, temporary marquees were used in its grounds to house more than 3000 wounded and nurses in need of beds.

The influx of soldiers meant patients with mental disorders were displaced from the site and relocated to other asylums across Scotland.

An annex built during the Second World War to cope with the numbers of wounded later became Bangour General Hospital.

Once the war was over, it took in burns victims, though rumours abounded of the "spirits of shell-shocked war veterans" who allegedly remained behind.

In the years that followed, it held the title as the leading maternity unit in the county until the new St John's Hospital in Livingston opened in 1989.

Bangour General Hospital transferred its services to the new hospital, closing for good in the early 1990s, followed by Bangour Village Hospital, which closed its doors for the final time in 2004.

Not all of Bangour's patients were happy to leave the vi llage they had come to know as their home.

As former resident Helen Taylor told The Herald in 1996, the prospect of leaving was "heartbreaking".

In an interview with journalist Nicola Barry, she said she had been there for almost 60 years.

"Originally I was put into Gogarburn. It wasn't bad, but the floors were bare and there wasn't any TV in those days," she said.

"Then, in 1956, I was moved to the village, into a dormitory. My friends are all here. And the staff are like the brothers and sisters I never had."

"I feel so safe in Bangour and I have no regrets about my life," Helen added.

"The world outside has really changed since my day. I wouldn't fit into society now. I won't return to the community. I don't want to."

Helen, however, did not have much choice and she, along with the rest of the patients remaining on the wards, left the village.

Since then, the site has had a brief role as a filming location for The Jacket in 2005, a film starring Kiera Knightley and Adrien Brody.

A planning application for a housing development was submitted in 2004 by Persimmon Homes, but they withdrew their bid in August 2008, citing the economy's downturn.

Talks between a Birmingham-based Islamic trust, NHS Lothian and West Lothian Council for turning it into a residential university also fell through in 2011.

Over the years, the NHS had to bring in 24/7 security as the old buildings drew in curious walkers and others with a more sinister plan.

Holes were being bored into the ground as thieves sought to steal copper pipes and anything else they could find of value, picking at the bones of the buildings like magpies drawn to anything with a glint.

Not all visitors were unwelcome, though.

In 2009, the grounds were used in a counter-terrorist exercise held by the Scottish Government to test decontamination procedures in the case of a nuclear, chemical or biological incident.

In total, 250 volunteer "casualties" were involved along with 400 emergency staff.

Today, the grounds remain largely the realm of local dog walkers, keen photographers and a few security guards.

Every now and then a spate of graffiti crops up as teenagers profess their undying love on decaying walls but otherwise the buildings are largely left in peace.

In 2013, NHS Scotland came under pressure to sell its empty buildings like Bangour.

At that time, there were 73 unused sites owned by the NHS in Scotland, with a total price tag of £66,594,309, or about £12 a head for every Scot.

Bangour Village Hospital was named the country's most expensive empty property, with a price tag of £8m.

If sold in this latest bid to offer it to the market, it is hoped the 215-acre site will be an opportunity to build a new community with up to 800 homes and the conversion of existing buildings to form a further 91 residential units.

Stewart Taylor, senior director at CBRE, which has been appointed along with Justin Lamb Associates by NHS Lothian to handle the marketing, said: "Bangour Village Hospital offers an exceptional opportunity to acquire a significant site in the heart of Scotland's central belt on the M8 corridor that is suitable for a variety of uses.

"Considerable work has been done by the vendor and their consultants to prepare the site for sale. We are confident there will be strong interest in the site and it's likely a closing date will be set in early course."