North Korean leader Kim Jong Un has thanked South Korea's outgoing president for trying to improve relations, a rare gesture of goodwill but one that analysts said may not be enough to head off growing tension between the two Koreas.

The warm words from North Korea to President Moon Jae-in came in an exchange of letters less than three weeks before Moon leaves office to be replaced by a conservative leader who has already signaled a tougher line on North Korea

Analysts are skeptical that North Korea's message heralds a broader improvement in relations and warn that the praise for Moon could be a bid to portray his successor, Yoon Suk-yeol, as responsible for any further deterioration in ties.