Top aides to the leaders of North and South Korea negotiated into the evening on Sunday after talking through the previous night to try to ease tensions involving an exchange of artillery fire that brought the peninsula to the brink of armed conflict.