Cammo Home Farm Steading was earmarked for demolition to make way for two £1.5 million villas after the city council said the structure was beyond repair.
Cala Homes East said it would pay the local authority in the region of £600,000 for the property earlier this year, but planning officials recommended councillors reject the bid.
Instead, they have backed a rival bid by property developer Kamran Akbar to rebuild the building on Cammo Estate, which is located in rural north-west Edinburgh.
Mr Akbar – whose family made its fortune running homeless hostels before moving onto hotel developments – intends to preserve the external features of the building, which heritage groups have been calling for.
It is understood his bid is lower, but is still worth several hundred thousand pounds.
Originally built as a golf clubhouse for the now-defunct Cramond Brig Golf Club, the C-listed property was converted to a farmhouse in 1952 but has lain derelict for ten years.
As the Evening News reported in July, heritage groups have accused council officials of misleading elected members over the sale of the building.
Officials – who backed the Cala Homes bid – failed to disclose that there were other offers on the table which did not involve Cammo Farm being demolished.
Historic Scotland said it could not back the demolition because there was a chance of preservation and ordered that the plans be halted.
The Cockburn Assocation has also accused the council of allowing the building to run into disrepair and suggested there was an opportunity to rectify this.
In a letter to councillors, Euan Leitch, assistant director, said: “The demolition of this building would reflect very badly on the council, which has gone to some length to prevent the demolition of the nearby Barnton Hotel, also category C-listed, but has neglected its own historic property at Cammo to the point of dereliction.
“The council will have failed in its duty of care if the building is lost and open itself to allegations of ‘do as we say, not as we do’ .”
John Bury, head of planning at the city council, said that officials were now satisfied that the plans to retain Cammo Farm were viable.
He wrote: “No details of its conversion and the level of structural intervention which will be required have been submitted as the applicant is unable to enter the building for safety and transactional reasons.
“However, the principle is sound. The interior was modified considerably when it was converted to a farmhouse and milking parlour in 1952-53, with much of the interior altered and several windows changed to louvres.
“Much of it is now ruined due to its poor state of repair. Provided the restoration materials used are representative of the existing building, the character of the building, which derives mainly from its external fabric, will be maintained and enhanced.”