The Malaysian government has said it will send a diplomat accused of attempted rape back to New Zealand.
This would allow Muhammad Rizalman bin Ismail to "cooperate fully and assist the New Zealand authorities" in investigations, it said.
The diplomat had returned to Malaysia last month shortly after the alleged attack, claiming diplomatic immunity.
Mr Muhammad Rizalman had been working at the Malaysian High Commission in Wellington for the past year.
He had been the staff assistant for defence at the High Commission.
He is accused of following a 21-year-old woman to her home in the suburb of Brooklyn on 9 May and attacking her there. Police have charged him with burglary and assault with intent to rape.
The 38-year-old diplomat subsequently left for Malaysia together with his family.
The Malaysian government said on Wednesday that the legal principle of "innocent until proven guilty" should apply to the accused.
"Malaysia has complete faith in the New Zealand legal system and has full confidence that Mr Muhammad Rizalman will be given fair treatment with dignity as provided under the law," it said.
It added that a senior military officer from Malaysia's defence ministry will accompany the diplomat, and the government would provide legal assistance if necessary.
Earlier this week, New Zealand and Malaysia presented conflicting accounts of how he left for Malaysia.
New Zealand released documents on Tuesday to local media showing that the Malaysian High Commission refused to waive diplomatic immunity for him.
But Malaysia said it had been willing to waive diplomatic immunity, and that the accused to return to Malaysia with New Zealand's consent.
Prime Minister John Key has said that "there is absolutely no question in my mind that this individual should be tried through the New Zealand system and face his penalties, if he is found guilty, in New Zealand."
Before Wednesday's announcement that Mr Muhammad Rizalman will be returned, Malaysia had said its defence ministry would conduct its own inquiry into the case.