A video posted on YouTube Wednesday appeared to show the amazing voyage of a Lego man sent into space on a homemade spacecraft by two Toronto students.

Mathew Ho and Asad Muhammad, both 17, used a weather balloon ordered online and a makeshift Styrofoam spacecraft to send the plastic astronaut 24 kilometers (15 miles) into the stratosphere, reports said.

Their high school principal Lecourgos Papathanasakis confirmed the "amazing voyage" to AFP, but neither of the teens was immediately available for comment.

An accelerated video clip posted online shows highlights of the Lego man during his 97-minute odyssey.

Ultimately, he is seen holding a Canadian flag with the curvature of the Earth and the blackness of space in the background.

Canadian media said the pair had fitted a box tethered to the balloon with four cameras and a cellphone enabled with a GPS (global positioning system) device to capture the journey.

They then added a nylon parachute stitched on Muhammad's mother's sewing machine to ensure that Lego man would return to Earth safely.

The balloon was filled with helium purchased from a party supply store.

The whole enterprise cost less than $500.

The duo then consulted a website to calculate the estimated landing spot of the weather balloon based on launch coordinates, prevailing winds and other data before launching it from a soccer pitch in nearby Newmarket, Ontario.

At seven kilometers (four miles) in altitude, the balloon traveled out of cell phone range and the GPS signal also cut out, so they went home and reportedly made dumplings.

Then Ho's iPad beeped. The Lego man had re-entered the atmosphere and touched down in a field 120 kilometers (75 miles) from the launch point.

(c) 2012 AFP