Gold edged lower as investors took profits after earlier hitting a near three-week high on turmoil in Iraq which lifted the metal's safe-haven appeal. The yellow metal was weighed down by technical selling after it failed to rise above its 50-day average near $1,285 an ounce.