The childhood home of Sherlock Holmes creator Arthur Conan Doyle has been rescued and transformed to house children with special needs.

The neglected cottage and garden adjacent to the Cameron Toll shopping centre in Edinburgh, where the author reputedly saw his first fairies, will be home to Dunedin School for educationally fragile children.

The cottage, known as Liberton Bank House, is a listed building and forms part of a site acquired by the Kilmartin Group for the construction of a new medical centre.

The developer assumed the role of good fairy when it agreed, subject to sufficient funds being raised by the school trustees and their partners, to gift the cottage to Cockburn Conservation Trust (CCT) for a nominal £1.

CCT is a building preservation trust, a charity which aims to preserve the built heritage of Scotland.

It has managed the £700,000 project for Dunedin School and passed ownership of the building to the school on completion.

Now that the building project is finished, the school is focusing on regenerating the cottage garden to meet the needs of the pupils for outdoor learning.

Plans are rooted in the building's heritage associations with the literary and academic figures of Conan Doyle and Mary Burton, a pioneer of women's higher education who was the first woman governor of Heriot Watt and the resulting "literary garden" will become available for wider community use outwith school hours.

Pupils referred to Dunedin have had their learning hampered by various conditions from Asperger's Syndrome to relentless bullying in mainstream education.

The less formal environment of a small school helps young people regain their self-confidence and become the best they can.

Among the many organisations that have contributed or pledged funds are the National Heritage Lottery Fund, the City of Edinburgh Council, the Wooden Spoon rugby charity, Children in Need, the Equitable Charity Trust, The Foyle Foundation, North British Hotels Trust, the Woolfson Foundation and the Kilmartin Property Group.

Colin McLean, Heritage Lottery Fund's manager for Scotland , said: "We are delighted to have been involved in saving this building which is steeped in history."