Rescuers in Malaysia freed a 16-year-old boy with a saw after his penis became trapped inside a toilet pipe when he attempted to have sex with it.

The boy, from the southern Malaysian state of Johor, began to panic when his privates swelled and became stuck inside the alloy tube, which was uncovered and protruding outwards from the wall.

The teenager had attempted to liberate himself for over an hour before he asked housemates for assistance who then desperately called the local fire and rescue station.

The boy's penis became trapped in a 30mm wide ally pipe which was uncovered and protruding outwards from the wall

Senior Fire Officer Seniman Idris of the Tangkak Fire and Rescue Station said they received an emergency call from the boy's residence around 10pm on May 20.

Emergency rescuers arrived at the scene with a metal cutting saw, attempting to manually cut the pipe to release the teenager.

With little success, the boy was then rushed to Sultanah Fatimah Specialist Hospital where doctors and firemen successfully freed the boy by removing the whole length of the 30mm wide pipe just before midnight.

The boy explained, 'the metal pipe is about six inches in length with a [thickness] of 5 millimeters, and is no longer used. The firemen had to cut the pipe first.''

Footage of the boy in the hospital bed show sparks flying and the boy wriggling uncomfortably as medics and fireman use a large circular saw to cut the pipe.

'The case was resolved with the expertise of the hospital and the victim was stable,' Fire chief Seniman Idris said.

Video footage shows the teenage boy wiggling uncomfortably as doctors and firemen from Sultanah Fatimah Specialist Hospital tried to cut the metal with a special circular saw

Sparks are seen flying as doctors attempt to cut through the special circular saw and trying their best not to harm the boy's organ

The local firemen advised residents to seal similar pipes to prevent similar further future incidents.

While the teenager returned home with only minor injuries, the incident caused his privates to be swollen.

'The case was resolved with the expertise of the hospital and the victim was stable,' Fire chief Seniman Idris said