After winning justice for the Gurkhas, Absolutely Fabulous actress Joanna Lumley has added her name to those trying to stop the home being demolished.

Lumley, who has dismissed calls she should run for parliament after the success of her battle for settlement rights for Gurkha soldiers, has signed up to the fight to preserve Moat Brae House in Dumfries.

The Georgian mansion, which is B-listed, is where JM Barrie played as a schoolboy at nearby Dumfries Academy.

Barrie later described the house and garden beside the River Nith as an “enchanted land” where the story of the Boy who Never Grew Up and the world of pirates and fairies took shape.

Lumley has a house in Dumfriesshire and a public meeting set up by the campaign to save the house heard that the actress had pledged her support. On Friday, Peter Pan Moat Brae Trust spokeswoman Cathy Agnew told a meeting at Dumfries Academy’s Minerva Hall: “Negotiations are taking place and we are optimistic.

“It could cost up to £3m to restore the house. It is a major challenge but because of the worldwide fame of Peter Pan we hope to make a global appeal.”

Ms Agnew then revealed that Joanna Lumley had pledged her support and had offered a “generous donation”, but did not reveal how much.

The mansion was the home of one of Barrie’s classmates in the 1870s and later became a nursing home before closing in 1997. It was sold at auction but lay empty until last year when it was bought by ­Dumfries-based Loreburn Housing Association for a reported £180,000. The house was badly vandalised and dilapidated but the association said it planned “to save it for the town”.

Then, earlier this month, the association announced it intended to pull the house down for safety reasons, retaining only the facade and using the site for housing and a visitor centre. The trust said they offered the association £50,000 for the property.

Restoration architect James Simpson said the 183-year-old mansion, designed by architect Walter Newall, had suffered water damage but could be saved. Mr Simpson said: “I know other buildings in the same ghastly state that have been successfully restored. But it is urgent to make it wind and waterproof and that will cost about £25,000.”

At the meeting, trust chairman Roger Windsor said his vision was to restore the house to its former glory, and quoted Barrie: “Dreams do come true if only we wish hard enough.”

Lumely’s fight to win UK settlement rights for Gurkhas captured the public’s imagination in the UK and in the Gurkhas’ native Nepal.

A popular tourist site in the Himalayan country (Mattikhan Hill) was renamed in honour of the actress, whose father was a Gurkha officer.