Malaysia has agreed to release the body of Kim Jong-Nam to North Korea in return for the release of nine Malaysians being held there.
Mr Kim, the half-brother of North Korean leader Kim Jong-Un , died last month after two women smeared a deadly nerve agent on his face at Kuala Lumpur airport.
The killing, which has been widely blamed on Pyongyang, led to the breakdown of Malaysia's normally close relations with the secretive regime.
In tit-for-tat moves, the two countries first withdrew their ambassadors, then banned each other's citizens from leaving its soil.
But the day after, Malaysia's Prime Minister Najib Razak, adopted a more conciliatory tone, saying the dispute would be solved through quiet negotiations.
Those talks, which he described as "very sensitive", have been successful as on Thursday, Mr Razak announced the deal.
He said: "I had a deep personal concern about this matter, and we worked intensively behind the scenes to achieve this successful outcome.
"Many challenges were overcome to ensure the return of our fellow Malaysians."
It is not clear if three people wanted by Malaysian investigators over their alleged role in the assassination are among the North Koreans now being allowed to leave Malaysia.
Pyongyang has denied any involvement in Mr Kim's murder, disputing the results of an autopsy and even denying the man is Mr Kim, referring to him as Kim Chol, the name on the diplomatic passport he was carrying when he died.
But South Korean intelligence sources are confident Kim Jong-Un's regime was behind it, as they believe he has issued standing orders for the elimination of his elder half-brother.
Two women - one Vietnamese woman and one Indonesian, who claim they thought they were involved in a prank - have been charged with killing Mr Kim.
CCTV footage shows the pair approach Mr Kim as he waited for a flight and smearing VX nerve agent on his face. He died within 20 minutes.
In a separate development, it has been revealed that Malaysian police at first mistook Mr Kim for a South Korean national after examining his passport in the chaotic aftermath of his death.
Officers confused the Democratic People's Republic of Korea, the formal name of North Korea, with the Republic of Korea, the official name of its estranged southern neighbour, sources told Reuters.
Once informed, the South Korean embassy quickly pointed out the error, otherwise the true identity of the murdered man might never have become known.