After deadly fighting and a tense military buildup, both sides agree to pull back troops but the long-standing border dispute still threatens peace.