The history of hostelling in Scotland took a sharp if soundless twist last week when James Urquhart, a resident of Coldingham on the Berwickshire coast, opened a letter over his breakfast coffee. The Scottish Government informed him that, under community right-to-buy legislation, his company had been granted first refusal to buy the 36-bed youth hostel at Coldingham, earmarked for closure by the Scottish Youth Hostel Association (SYHA) last September.

"Ministers believe it is in the public interest that the community interest be registered," the letter said. "The opportunity to purchase the land and building for the long-term benefit of the community would deliver the intentions of the legislation."

If Urquhart, who is secretary of the 100-strong team of the newly formed Coldingham Sands Community Company (CSCC), is successful in raising the money required, he will have pulled off the first-ever community buy-out of a British youth hostel. "We're absolutely delighted with the decision and feel that the Scottish Government is being very supportive," he says.

Coldingham's community buy-out flies in the face of the recent trend of Scottish youth hostels being sold off to private purchasers. The total number of SYHA-owned hostels is 47. Fifty years ago, there were 90.

The company proposes to retain the property as a hostel, offering budget self-catering accommodation as well as more sophisticated facilities, and trying to appeal to surfers, birdwatchers and divers as well as walkers. The fantastic Edwardian ballroom could act as a function room for weddings and business conferences in the off-season.

"We are not into asset-stripping," says Ged Hearn, chair of the CSCC. "This is about the benefit to and sustainable development of the local community."

Smart work in putting together the labour-intensive application and submitting it just hours before the hostel went on the open market secured CSCC's unique victory. It means the SYHA must give the local community first refusal. Although the property did briefly go on the open market in February, it was withdrawn as soon as the community's buy-out application was made public.

Though the news has been warmly welcomed in Coldingham, celebrations have been somewhat subdued. "The real work starts now," says 48-year-old Hearn, an IT project director for Lloyds TSB in Edinburgh and a part-time builder. "Now we need to put together a viable business plan and to start applying to grant-giving bodies for money."

First, however, the Scottish Government will carry out an independent valuation of the property. After that, the CSCC will carry out its own survey to ascertain what work needs to be done. "The asking price was offers over £450,000 but we have no idea what the value is," says Urquhart, 61, a former NHS Scotland statistician and now artistic director of the New Strides theatre company. "We believe a similar amount may be required for refurbishment and redevelopment."

Community groups have access to grants that the SYHA, a not-for-profit body with charitable status, does not. The CSCC is applying to grant-giving bodies such as the Big Lottery, which could provide up to 85% of the valuation price. But that still means it would have to raise another 15% from other grant-giving sources and through its own fundraising efforts. "It's by no means a done deal," says Hearn. "This won't be a pushover, and it's going to be really, really hard work."

So why bother? Because, he says, the potential returns to the local economy are immeasurable. "Tourism in this area has really taken off in the last few years, and the closure of the hostel would mean it would not be able to accommodate visitors on a large scale." He cites the recent example of the Sea Kayaking Association having to cancel a booking of all the B&Bs and hotels in the area for a long weekend because there was not enough accommodation for its 100 members. "That booking alone would have brought in about £10,000 to the area."

The nearby St Abbs Haven Hotel, which had the largest function room in the area, was recently sold off to a private developer who turned it into flats. The CSCC sees huge opportunity in the fact that Coldingham has the only hostel on the coastal route between Edinburgh and Newcastle. "It was operating at just under 50% capacity, which we think is really great in terms of potential," says Urquhart.

Coldingham has its own post office, butcher, school, garage and pubs - all of which would, it is argued, benefit from the increased tourism afforded by refurbishing and modernising the hostel. "This is the most fabulous surfing attraction on the east coast, with 50 people a day at peak times. Birdwatching at St Abbs Head, now a nature reserve, is very popular - and for the past two years there's been an upsurge in the number of Scottish families taking short breaks."

But not all youth hostels have the potential to tap into a tourist gold-mine. Many are purposely situated in Scotland's most remote places, in keeping with the association's mission when it was established in Scotland in 1931: "To help all, especially young people of limited means, to a greater knowledge, love and care of the countryside, particularly by providing hostels or other simple accommodation."

The late Alastair Borthwick, a former features editor of this newspaper and the author of Always a Little Further, the seminal celebration of youth hostelling first published in 1939, was famously struck by the socialist ethos of youth hostels. He wrote: "I cannot rid myself of the conviction that the youth hostel movement is one of the more important social innovations of this century. The vast majority of its members have so little money that they could not, without the help of the hostels, spend their weekends in the country and in the fresh air there appeared to be no class of society to which the appeal of the hostels did not extend; and so they were, and, to my mind, still are, the greatest library of ideas and human experience in Scotland."

Of course, travel habits have changed over the years, and the demand for more sophisticated budget accommodation is increasing. Modern travellers demand private rooms, en-suite facilities, restaurants and internet access - all the elements that were once anathema to the youth hostel movement, whose shared dormitories, curfews and chores were designed to encourage community spirit among fellow travellers. Many modern hostellers have cars, which once were not allowed; hostels that are inaccessible by road are therefore less popular.

The SYHA says it is under pressure to comply with these changes. Chief executive Keith Legge explains: "While it is always sad to close hostels, we have to accept there is no benefit in keeping them open if associated costs on maintaining and improving the buildings to meet the requirements of current legislation and visitor demands are not viable or if they are located where hostellers don't want to go." In many cases, the proceeds of a sale will go towards the upkeep of another hostel - profit from Coldingham will be diverted to the Melrose hostel, and proceeds from the two hostels being sold in Skye, Armadale and Kyleakin, will go towards building a purpose-built hostel on the mainland. And the SYHA celebrated its 75th birthday, in 2006, by opening Edinburgh Central, a 300-bed city hostel with all mod cons.

But some commentators feel it is giving up too easily and that diverting funds from remoter hostels to form what appears to be a more centralised network is a misjudgment. "I wonder if the SYHA has lost its way," says Cameron McNeish, editor of TGO (The Great Outdoors) magazine. "My great fear is that that youth hostel movement as we know it will disappear altogether, and that we'll be left with a chain of cheap hotels."

While he does have some sympathy for the association, because it obviously has only a finite source of money, he claims it is selling off its remote rural hostels and investing in its city-centre ones at a time when demand for the simple dormitory accommodation offered by private rural hostels is at an all-time high. If young people are body-swerving the more traditional spots, the older demographic is not," he says.

"I'd say there is a need for even more private bunk-houses, so it seems to me that the SYHA should be investing what money they do have in their rural hostels instead of trying to compete with city-centre Travelodges."

Where will it all end? Keith Legge is adamant that the SYHA is here to stay. "We remain completely committed to our hostel network, and in particular to those small hostels in remote areas such as Glen Affric and Loch Ossian, which are not viable for commercial operators." These are the very hostels McNeish cites as what all hostels could be: basic and eco-friendly, with their own wind turbines and reed beds for toilets.

Meanwhile, all eyes are on Coldingham and what the community buy-out will mean for the hostel's future. Its eager would-be new owners are keen to find out. As Urquhart puts it: "We think the sky's the limit for this place."