Bomb disposal experts were called to a Fife building site after white smoke started rising from the ground.
The construction site in Hugh Avenue was cordoned off as emergency services, including the Royal Logistics Corps Bomb Disposal unit, dealt with the situation.
Neighbours were told to stay indoors and keep windows closed after the alarm was raised shortly after midday on Tuesday.
Police Scotland said there was not thought to be any danger to the public but roads around the area were closed to keep people away.
The drama occurred at the former site of a Territorial Army centre, where social housing is being built for Kingdom Housing Association by Lochgelly-based Richard Street.
Construction firm director Stewart Shearer said it was thought a device such as an old flare from the TA had been struck and a small amount of white phosphorous released.
He said: “We took precautions and took everyone off site to let the professionals deal with it.
“Under their direction we spread it [the substance] and the army checked it to make sure it was all okay.
“Part of the site was the old TA centre so the thinking is that it was possibly an old smoke canister or a flare, rather than it being something naturally occurring, otherwise we would have found it during chemical testing.”
The incident occurred as the firm dug the final foundations at the site, later a Fife Council transport depot, where 27 cottages and cottage flats are being built.
A police spokeswoman said: “We received a report of smoke rising from the ground of a construction site on Hugh Avenue, Lochgelly, around 12.10pm on Tuesday, March 10.”
She said officers assisted the Scottish Fire and Rescue Service and an Explosive Ordnance Disposal team while road closures were put in place around Hugh Avenue.
She added: “There is not believed to be any serious risk to the wider public.”