IT was a fowl smell that had bewildered city residents for days.
Now environment chiefs have narrowed down the source of the stench, which wafted over the north and west of the city, to a chicken farm in Gogarbank.
The smell, which was reported from Clermiston to Leith Links, was caused by bedding used for the chickens at the Vion farm facility.
The company involved has vowed to address the matter as quickly as possible.
The Scottish Environment Protection Agency (SEPA) received calls from people asking them to sort out the smell.
On social networking site Twitter, residents inquired as to where the odour – described as both “pukey” and sewage-like – was coming from.
It is understood the 40-day cycle the farm runs for its bedding was coming to an end and, combined with a mild westerly wind, caused the smell.
A spokeswoman for SEPA said: “The smell is because the bedding used for the chickens is at the end of its 40-day life cycle and the mild westerly wind is blowing the smell from the farm out over the city.
“SEPA officers are now in discussions with the chicken farm company to rectify the problem and prevent it from reoccurring.”
Others complained that the smell was often noticeable near to the farm, particularly at Heriot Watt University and Edinburgh Park.
But because it was an agricultural set-up, there was nothing that could be done under planning laws.
A spokesman for Vion said: “SEPA officials visited the farm at around 4pm and we received the substantiated complaint.
“As a result, we are investigating with urgency so that we can take appropriate action.”
Initial suspicion surrounding the stink blamed the notorious Seafield Stench, which often riles residents of Leith and Portobello.
In June, the council launched an initiative to crack down on the problem – which stems from the nearby waste water treatment plant – which included the training of 18 officers who could respond quickly if there were complaints.
A broken pump at Seafield in 2007 caused a stench so bad it did not only affect Edinburgh, but drew complaints as far away as Denmark as it was blown across the North Sea.
Sewage is the most common source of complaints.
In 2008, residents in Loanhead said sewage smells dominated the area every time it rained, an issue that was eventually sourced to a blocked drain.
Sewage was again the problem a few months after that when householders in Northfield had to deal with “unbearable” fumes.