The nearly six-hour ordeal began yesterday when Leo tried to reach into the machine, located in a Melbourne hotel lobby, and became trapped by its anti-theft mechanism.
The vending machine was the first one he had ever seen.
"We live up in Arnhem Land, Northern Territory, and I don't think he's seen a vending machine before so he saw the Oreos, and some biscuits and a few other things," his father Aaron Shorthouse told CNN affiliate 7 News.
Rescue workers distracted the child, Leo, by showing cartoons to him on their phones and giving him a stuffed toy as they worked to free him but he had to be sedated at times.
More From This Section
"It was (hard to watch), especially seeing a young fellow like this after five and a half hours," Shorthouse said.
"He was a bit inquisitive...But he's good now."
Metropolitan Fire Brigade's Steve Watts said, "Look, over the years I've attended to several children with their arms in vending machines. This particular one is actually quite heavy duty and a real challenge for us."