FEW in Glasgow realised the importance of the run-down, soot-black building in the heart of the city. However, for more than a decade a small group of architectural historians has fought tirelessly to rescue it. Now, it appears that their efforts have paid off.

Alexander ''Greek'' Thomson's Egyptian Halls in Union Street, one of the city's most famous and neglected buildings, is set to be saved after an 11th-hour deal between developers, council officials and the national heritage watchdog.

The grade-A listed building, arguably one of the finest commercial edifices of its date in Britain, is to bought by Glasgow City Council just days before the authority's compulsory purchase option runs out on February 3. The block will then be held by the council until a final development package is put together by its private sector partner, Union Street Developments (USD) of Dundee, which owns 53% of the site.

The council's decision to buy the run-down masterpiece follows months of deadlock caused by a (pounds) 400,000 funding gap, and should leave USD able to convert the halls to shops and offices.

Last month, after six years of working with USD on the building's repair, the council gave the firm until January 17 to finalise a (pounds) 3.7m funding deal. If USD failed, the council warned it would let its compulsory purchase order lapse, putting the entire repair programme back to square one. USD said it was unable to comply because its public sector funders were insisting on (pounds) 400,000 of stonecleaning work it could not afford.

However, earlier this month Historic Scotland agreed to award USD a (pounds) 930,000 grant without the need for stone-cleaning, allowing an affordable (pounds) 3.3m funding package to fall into place. In a report to councillors this week, Rodger McConnell, director of the council's development and regeneration services, says the agreement with Historic Scotland was ''a major step forward''.

Mr McConnell added that the ''most pragmatic means of securing the future of the building'' is now for the council to buy it, then transfer it to USD when the company's paperwork is complete, even though this will expose the council to a potential (pounds) 40,000 legal risk.

''In this way USD can be afforded every opportunity to legally conclude agreements with other funders and demonstrate its ability to complete the refurbishment,'' he said.

If USD fails to deliver, the council would seek other partners to regenerate the site.

Gavin Stamp, chairman of the Alexander Thomson Society, who recently wrote to The Herald imploring the council to take action, said: ''The lesson is that people should act much more quickly and recognise the importance of our buildings and not let things get to this state.''

Completed in 1873 as a Victorian shopping gallery, the four-storey 27,000sq ft hall, turned architectural wisdom on its head, featuring thick stone columns - usually found at ground level - on the top floor.

No-one from USD was available for comment yesterday.

Last night work was under way to secure a warehouse designed by Alexander Thomson in Watson Street, Glasgow, after part of the back wall collapsed.

the work of an 'unknown genius'

It was not until 1999 and Glasgow's year of Architecture and Design that Scots woke up to Alexander ''Greek'' Thomson.

Born in Stirlingshire in 1817, the ''unknown genius'' built around 100 or so villas, terraces, tenements, commercial buildings, churches and monuments.

Most of the buildings Thomson designed between 1849 and 1875 survived until the 1960s before being demolished.

Fewer than two thirds of his buildings are still standing. Among those that have survived are Caledonia Road church in the Gorbals, the St Vincent Street church and Holmwood House, Cathcart.