Malaysia has said it wants to negotiate with North Korea despite an increasingly bitter dispute over the investigation into the killing of Kim Jong Nam, the long-exiled half-brother of North Korea's leader.

Malaysia has said two female attackers wielding VX nerve agent killed Mr Kim on February 13 at a crowded airport in Kuala Lumpur.

Malaysia's investigation has infuriated North Korea, which has dismissed the inquiry as politically motivated.

The dispute took a surprising turn on Tuesday, when North Korea announced that it was blocking all Malaysians from leaving the country until the dispute is resolved. Malaysia responded in kind and barred North Koreans from exiting its soil.

Deputy Prime Minister Ahmad Zahid Hamidi said on Wednesday that Malaysia is willing to negotiate.

"So far, we believe they are going to act rationally," he said. "We believe what is important for us is to maintain our diplomatic relationship with them because I think what is important is the safety of our citizens in Pyongyang."

Malaysian Prime Minister Najib Razak denounced North Korea's order as "an abhorrent act, effectively holding our citizens hostage" and a violation of international law.

Officials in Kuala Lumpur say there are 11 Malaysians currently in North Korea - three working at the embassy, two UN employees and six family members. About 1,000 North Koreans are believed to be in Malaysia, until recently one of the few countries where North Koreans could travel without a visa.

North Korea's surprise order came on Tuesday morning, when the official Korean Central News Agency said the country was banning Malaysians from leaving "until the safety of the diplomats and citizens of (North Korea) in Malaysia is fully guaranteed through the fair settlement of the case".

It was not clear, however, what would constitute a "fair settlement".

North Korea said Malaysia's diplomats and citizens "may work and live normally" during the temporary exit ban.

Malaysia is searching for seven North Korean suspects in connection with Mr Kim's assassination, including a North Korean diplomat. Police say three suspects are believed to be in hiding at the North Korean Embassy in Kuala Lumpur, a hulking concrete mansion behind a wall streaked with water stains.

National police chief Khalid Abu Bakar said Malaysia would not raid the embassy, which is protected under diplomatic law, but would wait for the suspects to emerge.

"We will wait. We will wait, and if it takes five years we will wait outside. Definitely somebody will come out," Mr Khalid said.

Malaysian police briefly blocked the embassy gates on Tuesday with a pair of police cars, but within hours embassy cars were again freely going in and out. By late afternoon there were only a pair of Malaysian patrolmen waiting in a police car outside the compound.

Malaysia has never directly accused North Korea of killing Mr Kim, though it has said the two women who poisoned him were recruited by a team of North Koreans. Malaysia says Mr Kim was killed with VX, a nerve agent and banned chemical weapon that causes convulsions and leaves victims unable to breathe. North Korea is widely believed to possess large quantities of chemical weapons, including VX.

In the attack, grainy surveillance video shows a woman approaching Mr Kim from behind in the airport terminal and reaching around to wipe something on his face. The other woman, who was apparently standing in front of Mr Kim, cannot be seen in the video.

The women, one from Vietnam and the other from Indonesia, were quickly caught and have been charged with murder. Both say they were duped into thinking they were playing a harmless prank.

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 citizen.

Mr Kim, who was in his mid-40s, had lived abroad for years and had reportedly never met his younger half-brother, North Korean ruler Kim Jong Un.

Sign up to our free newsletters

Get the best updates straight to your inbox:
Please select at least one mailing list.

You can unsubscribe at any time by clicking the link in the footer of our emails. We use Mailchimp as our marketing platform. By subscribing, you acknowledge that your information will be transferred to Mailchimp for processing.