The whale was first seen in the Northern Territory (NT) river over a week ago, prompting fears it may get stuck in shallow waters or hit a boat.
Two others also swam into the East Alligator River for a short time before returning to their sea migration.
The remaining whale managed to find its way out over the weekend during high tides, Parks Australia said on Monday.
It is the first known instance of humpback whales in the river in the Kakadu National Park, on the country's northern coast.
Officials had been monitoring the final whale closely since it was spotted up to 30km (18.5 miles) inland by people on boats.
Given its large size, the humpback had been considered unlikely to be disturbed by crocodiles unless it became stranded.
"There's no way we can lift a 12-16m humpback whale off the sandbar and that's potentially when the crocs would kick in," scientist Carole Palmer told the Australian Broadcasting Corporation last week.
"The last thing we want is a collision between a boat and whale in waters where crocodiles are prevalent and visibility underwater is zero," Parks Australia had added in a statement.
Authorities had banned boats along part of the river to clear a path to the ocean,
On Monday, officials said the whale appeared to be in good condition after swimming into the Van Diemen Gulf.
"This is the very best outcome we could have hoped for," said Dr Palmer, who works for the NT government.