Presiding Judge Amzer Simanjuntak told the packed Denpasar district court that -- when taking into account time already served -- the 14-year-old would be freed in just over a week and immediately deported.
The boy, who cannot be named because of his age, sat sobbing, his head bowed, as his father patted him on the back consolingly while the judge spoke.
Though he could have faced up to 12 years under Indonesia's tough narcotics laws, the panel of three judges said it decided to be lenient because he admitted to buying 3.6 grams of marijuana from a man in front of a supermarket and repeatedly expressed remorse.
The teen, who has been in an immigration detention center since his Oct. 4 arrest, earlier promised to enter a drug rehabilitation program if he was allowed to return to his home in Morrisset Park, just north of Sydney.
He said he had been struggling for some time with his addiction.
Australia -- which has seen dozens of its citizens jailed or placed on death row for drug possession in Indonesia -- had been closely watching the trial.
Many argued the boy was too young to be jailed.
But critics noted that dozens of Indonesian children tied up in people-smuggling cases have been languishing for years in Australian detention centers.