Security forces on Monday averted a tragedy with the timely detection of an improvised explosive device (IED) in South Kashmir's Kulgam district, officials said.