North and South Korea on Tuesday agreed on negotiations to resolve problems and military talks aimed at averting accidental conflict, after their first official dialogue in more than two years, as Pyongyang's nuclear weapons programme fuels tension.