North Korea said it was banning Malaysians from leaving the country as its diplomatic battle escalated dramatically over the poisoning death of Kim Jong Nam, the North Korean leader's estranged half brother.
Malaysian Prime Minister Najib Razak said the travel ban was tantamount to hostage-taking and said his country would immediately respond in kind by banning North Koreans from leaving Malaysia.
"This abhorrent act, effectively holding our citizens hostage, is in total disregard of all international law and diplomatic norms," Mr Najib said.
The extraordinary tit-for-tat moves intensified the breakdown in relations between the countries amid Malaysia's investigation into the murder of Mr Kim in a crowded airport terminal in Kuala Lumpur on February 13.
Earlier, the North's official Korean Central News Agency said that Pyongyang was banning Malaysians from leaving the country "until the safety of the diplomats and citizens of (North Korea) in Malaysia is fully guaranteed through the fair settlement of the case that occurred in Malaysia".
Malaysia is looking for seven North Korean suspects. Three of them, including an official at the North Korean Embassy, are believed to still be in Malaysia.
Mr Najib said: "I have also instructed the Inspector General of Police to prevent all North Korean citizens in Malaysia from leaving the country until we are assured of the safety and security of all Malaysians in North Korea."
Earlier, Malaysian officials had said the ban would affect only North Korean Embassy staff and officials, but officials expanded it to include all North Koreans. Police briefly cordoned off access to the embassy.
About 1,000 North Koreans are believed to be working in Malaysia. Before diplomatic ties disintegrated, Malaysia had been one of the few places in the world where North Koreans could travel without a visa. As a result, for years, it has been a quiet destination for Northerners looking for jobs, schools and business deals.
Malaysian Deputy Foreign Minister Reezal Marican told reporters at parliament that there are 11 Malaysians in North Korea - three working at the Malaysian Embassy, two United Nations workers and six family members.
North Korea said Malaysian diplomats and citizens "may work and live normally under the same conditions and circumstances as before" during the period of the temporary exit ban.
It also said that the Malaysian ambassador would be expelled, although he has already been recalled to Malaysia.
Malaysia's finding that the nerve agent VX, a banned chemical weapon, killed Mr Kim boosted speculation that North Korea was behind the attack. Experts say the oily poison was almost certainly produced in a sophisticated state weapons laboratory, and North Korea is widely believed to possess large quantities of chemical weapons, including VX.
In an attack that was caught on grainy surveillance camera footage, two women went up behind Mr Kim as he waited for a flight and wiped something across his face. According to Malaysian investigators, the substance was VX and Mr Kim was dead within 20 minutes.
The women, one from Vietnam and one from Indonesia, have been charged with murder. Both say they were duped into thinking they were playing a harmless prank.
Although there is growing speculation that North Korea somehow orchestrated the attack, Malaysia has never directly accused Pyongyang. Still, North Korea has slammed the investigation as biased and demanded Malaysia hand over the body.
North Korea has not acknowledged that the victim is Kim Jong Nam or a relative of its leader, Kim Jong Un. Instead, it refers to him as Kim Chol, the name on the diplomatic passport he was carrying when he died.
Custody of the body has become a flashpoint. Malaysia says it needs to conduct DNA tests to formally identify the body, but North Korea says it has no right to keep the body of a North Korean citizen.