The magistrate at Johannesburg's Randburg court said Britta Nielsen will return to Denmark accompanied by a Danish police officer later in the day.
Piet du Plessis, Nielsen's attorney, told court that the 64-year-old Danish civil servant "is cooperating fully" with international and Danish authorities.
She is the main suspect in a fraud case that caused a Danish government welfare agency to lose at least 111 million kroner ($17 million). In court, she sat quietly with her legs crossed, short hair dyed black, a cardigan over her arms and wearing sneakers.
Du Plessis read a statement saying Nielsen was willing to fly home, meaning no formal extradition was needed.
"We have made an agreement with the state that the matter against Ms. Nielsen would be withdrawn (.) and as a free person she would accompany" officials back to Denmark, du Plessis told The Associated Press.
Nielsen's adult son also can travel back to Denmark where he faces criminal charges for handling stolen goods, the court in Kempton decided Thursday, according to Danish media. South African authorities have identified him as Jimmy Hayat. A Danish court has barred media in Denmark from naming him.
He was arrested Oct. 30 as he was about to leave the country with two diamonds in his luggage.
Nielsen was arrested in Johannesburg Monday and had 648,700 rand in cash ($46,000) in her possession which was confiscated.
On Oct. 10. Denmark's minister for children and social affairs, Mai Mercado, said Nielsen, whom she described as "a trusted employee," had "abused" her position to commit systematic fraud from 2002 to 2018.
It was not clear how Nielsen stole the money, but it appears she had privileged access to the agency's computer system.
A preliminary probe by the Ministry for Children and Social Affairs says that at least 274 money transfers were made during the period.
Olsen contributed from Copenhagen, Denmark.
Copyright 2019 The Associated Press. All rights reserved. This material may not be published, broadcast, rewritten or redistributed.