Story highlights It took rescuers nearly six hours to free boy, who'd never seen vending machine before

Child was distracted with a toy bear and cartoons played on smartphones

Boy's family comes from Australia's remote Northern Territory

(CNN) A 4-year old boy has been freed after his arm was stuck for hours in the first vending machine he'd ever seen.

The nearly six-hour ordeal began Sunday when the child tried to reach into the machine, located in a Melbourne hotel lobby, and became trapped by its anti-theft mechanism.

"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.

Arnhem Land is a very remote, rural region located at the very northern tip of the country. It has a population of about 16,000 spread across 37,000 square miles.

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.

Read More