A terrified teenager had to be rescued from the top of a 40m crane in Perth's CBD overnight after he scaled the structure but was too frightened to climb back down.

Police said they were alerted to the situation by security guards at the Pier Street construction site, who heard the 13-year-old boy crying out for help.

Police arrived around 4.30am and found the boy trapped on a cold night where temperatures plunged to 8C.

"He had climbed up the crane with two friends, who had since climbed back down and fled the scene, leaving him trapped on his own," police said in a statement.

He was rescued by officers from the Department of Fire and Emergency Services, checked over by paramedics and brought to hospital for a precautionary check-up.

Ten News reporter Beau Pearson quoted a witness who allegedly heard the boy shout "I've just had a bong and can't get down".

"Kids these days," the journalist added.

Police are investigating the incident.