New Zealand has agreed to repatriate an alleged militant with the so-called Islamic State and her two young children, who have been detained in Turkey since February.

The decision follows a bitter dispute with Australia over which country needed to shoulder responsibility for the woman, who had been a dual citizen of both countries until Australia stripped her citizenship under its anti-terrorism laws.

The woman and her children were arrested when they tried to illegally cross from Syria into Turkey, according to the defence ministry in Ankara.

Turkey identified her only by her initials, SA, while New Zealand media identified her as Suhayra Aden, who was 26 at the time of her arrest.

New Zealand's prime minister Jacinda Ardern said New Zealand had taken into account its international responsibilities and could not remove citizenship from anyone if it left them stateless.

She said: "I made very strong representations to Australia that she should be permitted to return there.

"Her family moved to Australia when she was six and she grew up there before departing for Syria in 2014 on an Australian passport.

"Unfortunately, Australia would not reverse the cancellation of citizenship."

Australian home affairs minister Karen Andrews said the woman lost her citizenship as a result of her own actions, and that ending citizenship for dual nationals engaged in terrorist conduct was an integral part of Australia's response to terrorist threats.

"The government's first priority is always to protect the Australian community," Ms Andrews said.

Ms Ardern said the safety and wellbeing of New Zealanders was the government's paramount concern. She said there had been extensive planning with the police and other agencies.

"I can assure people great care is being taken as to how the woman and her young children are returned to New Zealand and how they will be managed in a way that minimises any risk for New Zealanders," Ms Ardern said.

Authorities declined to say when the family would be repatriated, citing legal and security concerns.

Ms Ardern said anyone suspected of being associated with a terrorist group should expect to be investigated under New Zealand laws, although the case remains a matter for the police.

New Zealand police confirmed an investigation is under way but declined further comment on whether the woman would face any criminal charges.