The Australian Department of Foreign Affairs and Trade released very little detail on the accusation and it is not known whether the alleged assault was by a fellow soldier.
The female soldier reported the incident to her superior officers on Wednesday and the matter is now being investigated, DFAT said, AAP reports.
The alleged assault occurred last month at the military base at Tarin Kowt in Oruzgan province where she was on deployment.
Australia's Department of Defense said it would not be commenting any further about the incident while the investigation was underway.
However, it said inappropriate behavior would not be condoned, AAP reports.
The department said it was providing support to the soldier.
A Defense spokesman said the female soldier has since decided to leave the base and return to Australia.
"The soldier is completing her deployment early and is returning to Australia in accordance with her wishes," he said.
"Defense does not condone inappropriate behavior and treats such allegations seriously," a defense spokesman said.
The incident has sparked debate about whether the recent government decision to remove all barriers to women serving in combat units was wise, the Sun Herald reports.
But this was strongly rejected by the Australia Defense Association's executive director Neil James who said that was an "absurd" attitude.
"Claims that an alleged sexual assault on a female soldier at the Tarin Kowt base in Afghanistan somehow proves females should not serve on the frontline or in combat roles are absurd," he said.
"The ADF has employed female nurses in similar roles and wartime locations since the Boer War (1899-1902) and female personnel more broadly overseas since the late 1980s," the Sun Herald reports.