The tide is turning for many of Scotland's Victorian swimming pools. But while some are thriving, others are drowning.

A week today, on October 18, the Glenogle municipal baths in Edinburgh's Stockbridge will close. But nobody is swimming in tears - because when they reopen in 18 months' time, they will have been modernised with all their Victorian glory intact. A vigorous public campaign overturned a proposal by Edinburgh City Council to hand the building, which dates from 1898, over to private developers, and now the ugly ducting that encircles the original balcony will be removed, the cumbersome boiler room will be resited to the basement (revealing original windows opposite the entrance to the pool) and solar panels and modern units will replace the inefficient and costly heating system.

The £5.3m price tag for Glenogle's upgrade is being met entirely by Edinburgh City Council, which has already spent £8m on restoring the capital's four other Victorian public baths: Dalry, Leith Victoria, Portobello and Warrender (Morningside).

This victory for Victoriana is in direct contrast to the plight of the magnificent art deco Bon Accord baths in Aberdeen, the oldest remaining in the city, which were, despite protests, closed down permanently by the city council on April 1 this year. The B-listed building, currently unused, sits next door to a new glass-and-steel Cannons Health Club. A council spokesman said the Bon Accord's future was "uncertain", though there is hope a private buyer will be found. "We had to save £27m from our budget this year, and it was one of the victims," he said. "We closed Bon Accord in order to keep our heads above water."

Back in Edinburgh, the beautifully crafted building is only a part of Glenogle's powerful appeal. The fact the baths are situated in the middle of a former working-class area seems also to have a part to play. The streets of the Stockbridge colony houses that were originally built by the Edinburgh Co-operative Building Company to house workers and their families had no running hot water, let alone baths, when they were first built. Like all of Scotland's municipal baths at the time, Glenogle incorporated a steamie (wash-house) to help locals stay clean, as well as private baths and at least three differently sized pools (men's, women's and children's). Even if it now serves a mixed demographic that includes many middle-class professionals, this beautiful little pool seems to have become a symbol of nostalgia for that paternalistic socialism of the nineteenth-century city fathers. Restoring it thus preserves not only the city's architectural heritage but also its social history.

Fay Padget, 64, and Margaret Finlayson, 46, both from Stockbridge, are adamant: they see Glenogle as "their pool". It's a dependable local resource - one that's within walking distance of where they live. With their friends Fiona Shale, 49, of Inverleith, and Joan Polson, 65, of Leith, they signed the 15,000-signature petition to save Glenogle.

Margaret says her rheumatoid arthritis has been greatly helped by going to the pool, and June Peebles of Edinburgh Leisure, the not-for-profit trust that manages the pool, plus many other facilities, on the council's behalf, understands that only too well. "The therapeutic value of swimming should not be underrated," she says. "Not everyone can pound a treadmill. Swimming is a great social leveller."

Nowhere was this more obvious than in eighteenth-century Glasgow, where swimming in the Clyde was so popular that, in 1790, the Glasgow Humane Society was established to rescue drowning people. As shipbuilding grew as an industry, river pollution increased - and, tenements being overcrowded and unhygienic, improvements in public health became increasingly important. "Glasgow, then as now, was at the forefront of developments," says William Mann, secretary of Glasgow's private Western Baths and author of The Baths: A History of the Western Baths from 1876 to 1900.

The Glasgow Corporation Annals of 1816 state: "In a populous and manufacturing community like this, where there are so many persons who are prevented from the free use of air and wholesome exercise, it becomes desirable, if not necessary, that public baths should be establish'd for the use of the operative classes of the community, as well as for the more affluent."

To Glasgow's credit, 10 of the five private and six public baths built in Scotland between 1870 and 1885 were located in the city. It had 20 public baths and washhouses by 1914.

The Victorian or Edwardian public baths in Alloa, Dundee, Dunfermline and Renfrew, as well as those in Edinburgh, have been restored and are still in use. But the tangible legacy of this part of Glasgow's celebrated philanthropic past has all but disappeared. There are only five of the original 20 baths buildings left from this period, and only one of these, North Woodside (1882), is currently in use. Govan (1901), derelict since it closed in 1993, was demolished last year to make way for social rented housing. Whitevale Street in Bridgeton (1902), Govanhill (1917) and Pollokshaws (1920s) are still standing; Whitevale Street has been derelict since the 1970s. "There are no proposals in the offing for either Pollokshaws or Whitevale Street," said a Glasgow City Council spokesman.

Parkhead (1906) was on the register of buildings at risk until 1995, when it was converted into flats. Whiteinch (1889) was also converted into flats, retaining much of the original interior.

North Woodside's stunning interior was substantially reconstructed in 1990 behind the original facade. A similar future is planned for Maryhill (1898), due to reopen next year; Govanhill is the subject of debate.

Much of this anomaly is down to the vagaries of public-sector ownership. "Local authorities are beholden to the general public and constantly have to revise their buildings to suit changing demands, whereas private clubs remain largely immune to demand for change from their members," explains Simon Inglis, co-author of The Historic Indoor Swimming Pools of Great Britain, to be published next year by English Heritage.

Ranald MacInnes, principal inspector with Historic Scotland, says it's not all bad news for Glasgow's pools. "Five is better than none, and the good news is that work is being done at both Govanhill and Maryhill," he says.

"In the 1970s and 1980s, it was thought that just swimming up and down a pool wasn't enough, and local councils started building big multi-discipline sports centres, leaving the problem of what to do with existing buildings. But now there is a return to thinking small and sustainable - and with people thinking about the London Olympics and the Glasgow Commonwealth Games, there is a growing interest in swimming."

It does appear that ordinary people, for whom these precious buildings were originally built, are fighting to reclaim what they see as rightfully theirs. But it is a case of too little, too late?

The closure in 2001 of the B-listed Govanhill baths in the south of Glasgow - the only original, mostly unaltered Edwardian public baths in the city still in use at the time - prompted a huge public outcry against Glasgow City Council, which wanted to sell the building to private developers. One of the reasons offered for the closure was that a new leisure centre had been built in the Gorbals. Govanhill, it was said, had become financially non-viable.

Historic Scotland, however, claims no enquiry had been made about a repair grant, and the pool closed despite the Govanhill Baths Community Trust (GBCT) amassing 30,000 signatures in support of keeping it open.

The building has remained derelict in the intervening seven years, but it is beginning to look as if it may re-open after all - without council funding. "The trust has been advised that, as the facility was closed as part of a leisure investment strategy for the city, the council is unlikely to be a major funder," explained a spokesman.

A project team of prominent bodies is involved in finalising a planning application, to be submitted by the end of this month, and in November a second-stage business plan will be submitted, detailing how the trust hopes to raise the £9m or so necessary to save and restore the building.

"We have the great and good behind us now, and enjoy the full support of Glasgow City Council," says GBCT chair Andrew Johnson. "But they're not giving us money."

Because it is a B-listed building, the facade, balcony, the three original swimming pools and 10 of the 50 original private baths must be retained, though the original steamie will be demolished and the original Turkish baths and sauna pulled out. Campaigners are hopeful that funding can be secured from a variety of sources, including up to £3m from the Big Lottery, and that work can begin in 2010.

"It's clear that many people, not just locals, are interested in this building," says Johnson. "There's a deep feeling about the historical nature of old public baths - a sense that they touch base with our community roots, give us a sense of belonging. They were built for the working classes, and I think there is a genuine sense of wanting to reclaim those roots. They are symbols of responsible social welfare."

Yet the city council is giving £7.5m towards the restoration of Maryhill baths, following sustained local campaigning for its reprieve. This will see the original facade, pool, pillars and slate roof all retained - although the original interior has already been removed. The reason for this spending anomaly is that there is an acknowledged shortage of sports facilities in Maryhill. "The retention of many of the original features of the baths will ensure that Maryhill will see one of its most distinctive buildings beautifully brought back, to play a key part in community life," said a council spokesman.

Simon Inglis describes such baths as "community glue", worth fighting for "because of what they stand for". But the remainder of our derelict Victorian pools are on their last lap - unless local communities brace themselves, dip their toes in the water and compete for them before it's too late. Additional research by Gavin Stuart.

Health, hygiene and a way of life: Glasgow's bath-houses Public baths were built to promote the health and hygiene of citizens, many of whom lived without running hot water at home. Bathtubs were in individual cubicles for personal washing, and bath-houses often, though not always, incorporated swimming pools for further health and enjoyment.

They also contained steamies, or wash-houses, providing hot tubs for washing clothes, and large mangles and driers.

Whitevale Street baths and wash-house in Glasgow's Bridgeton (opened in 1902) differed from the city's other baths in containing a Turkish bath and a gymnasium. There were 66 stalls in the wash-house, which could be hired for tuppence per hour. Ingeniously, the swimming pool could be drained and lined with seating to convert the space into a rudimentary concert hall, which boasted a capacity of 1500 people.

The facilities at Maryhill (opened 1898) included a swimming pool measuring 75ft by 35ft, and 25 private baths for men and six for women. There were 36 wash-stalls and two washing machines in the "steamie".

The Whiteinch public baths and wash-house (1889) was built next to the public halls and the building contained a large swimming pool of 75ft by 35ft 6in; a small pond of 40ft by 20ft; 16 slipper baths for ladies and 31 for men; 43 wash-stalls; 16 washing machines and (from 1926) a Turkish bath with room for 20 people. Sun lamps were installed in the 1930s. Govan public baths (1902) contained a smaller pool but had 54 private baths and 75 wash-stalls in the steamie, more than any other facility in the city.