SEOUL, South Korea — North and South Korea agreed Thursday to hold their first government dialogue in years, an abrupt change after tensions over the North’s nuclear program this year escalated into one of the divided peninsula’s worst crises.

The announcement raised hopes that the two countries were moving toward a thaw in relations after a prolonged standoff in recent years that included military provocations from the North and retaliatory economic penalties from the South.

The agreement came after North Korea made a surprise overture on Thursday, proposing official negotiations with the South on reopening two shuttered joint economic projects, including the recently closed Kaesong industrial park, as well as humanitarian programs. South Korea, which has demanded such talks in recent months, quickly accepted the offer, proposing a cabinet minister-level meeting in the South Korean capital, Seoul, next Wednesday.

North Korea on Friday welcomed the quick response from the South and proposed working-level talks in Kaesong on Sunday to prepare for the proposed cabinet-level meeting. It also said it was restoring cross-border communications lines it had cut off earlier this year out of anger over joint United States-South Korean military drills.