The 18-year-old Semenya, who stormed to victory in August's World Championships in Berlin, underwent gender verification tests this summer in South Africa and Germany and a panel of experts has been studying the results for the IAAF.
South Africa's government, Semenya's lawyers and the IAAF had reached total agreement that she will retain her gold medal, title and prize-money because she has been found "innocent of any wrong," the ministry said in a statement.
Agreement was also reached with the IAAF that scientific gender tests conducted on Semenya will be treated as confidential and there will be no public announcement of the results.
The IAAF said it could not confirm the details in the statement but said it had accepted the resignation of Athletics South Africa (ASA) president Leonard Chuene from the IAAF Council and had opened a formal investigation into the handling of the Semenya affair by Chuene and ASA.
Chuene and his board have been suspended by South Africa's Olympic governing body pending an investigation after Chuene admitted he lied when he denied Semenya had undergone gender tests before the World Championships.
The sports ministry said Semenya would decide her future on her own.
"The implications of the scientific findings on Caster's health and life going forward will be analysed by Caster and she will make her own decision on her future. Whatever she decides, ours is to respect her decision," the ministry said.
South Africa had requested the IAAF to apologise at the way the Semenya saga had been handled.
"Their response is: 'It is deeply regrettable that information of a confidential nature entered the public domain.' The IAAF is adamant that the public discourse did not originate with them," the ministry said.
Australia's Daily Telegraph, citing an unnamed source, reported in September that Semenya was a hermaphrodite with both male and female sexual characteristics.
The IAAF has not confirmed the report.
Semenya and family members say the runner is female and that publicity surrounding the case has caused hardships.
South Africans have reacted angrily to the case and the country's ruling African National Congress has denounced the IAAF and ASA for their handling of the sensitive matter.
IAAF puts debate on Semenya case on hold
ASA apologises to Semenya over gender tests issue
SA athletics chief lied about Semenya tests
With tons of cash, China's buying the world
Bolt ends stellar year on high