The Malaysian diplomat accused of attempted rape is being returned to New Zealand after he invoked diplomatic immunity and fled home.

On May 10, Muhammad Rizalman bin Ismail was arrested on charges of burglary and attempted rape in relation to an alleged attack on a 21 year-old woman in her home in Brooklyn in Wellington.

The Malaysian government is currently ''making arrangements'' to send Rizalman back to New Zealand, Malaysia's Ministry of Foreign Affairs said in a statement.

''In this regard, Malaysia and New Zealand are discussing the required legal procedures to enable this to be done according to the applicable international and domestic laws.

''Both Malaysia and New Zealand are committed to ensure that the arrangement to transfer Muhammad Rizalman to the New Zealand authorities is handled in a tactful manner, seamless and in accordance with the due process of law and respecting his fundamental rights.''

On the same day Rizalman was arrested the New Zealand Ministry of Foreign Affairs and Trade (Mfat) issued a formal request that Rizalman, an assistant to the defence attache for the Malaysian High Commission in Wellington, waive diplomatic immunity in order to face charges.

But two days later Mary Oliver, the deputy chief of protocol at Mfat, met counterparts at the Malaysian High Commission to discuss the situation.

According to the Malaysian foreign minister it was at this meeting that "the New Zealand side had offered an alternative for the accused to be brought back to Malaysia. It was never our intention to treat the matter lightly''.

Rizalman left the country on May 22, a day after Malaysia declined the request to waive immunity, asking for the police case to be sealed.

Last month John Whitehead, Secretary to the Treasury from 2003 to 2011, was appointed to head a ministerial inquiry into how Rizalman was able to leave the country.

According to Minister of Foreign Affairs Murray McCully, the inquiry would focus on ''the appropriateness and robustness'' of procedures to deal with circumstances in which a waiver of diplomatic immunity is sought by the Government, as well as the particular events in relation to the Malaysian diplomat.