People climbing skyscrapers or hanging from their edges just for a selfie? We've seen quite a few, especially in Dubai, the land of far-reaching towers. 

But, these stunts don't go unpunished, and now a British YouTuber has to learn that the hard way. 

James Kingston, known for climbing buildings and cranes around the world, was arrested by Dubai's Criminal Investigation Department (CID) following his latest stunt in the emirate. 

"Four undercover agents plucked me from my hotel room earlier today with no warning," Kingston tweeted following the arrest. 

Kingston was taken in for questioning by the CID on Saturday, but was released from custody 24 hours later. 

"He was detained on Saturday and was accused of endangering his life and others. If something went wrong with his stunt then he might have fallen on someone under the building,” Brigadier Salim Khaifa Al Rumaithi, director of CID, told Gulf News.

In February, Kingston posted two videos of him climbing cranes in Dubai, "Epic Crane Climb in Dubai" and "Craziest Thing I've Ever Done."

The video that got him in trouble was the latter, according to Gulf News.

It's a step-by-step video of Kingston's stunt, and has garnered over half a million views on YouTube since it was uploaded. 

Following his release, Kingston was given a written warning not to perform such stunts again. 

The other video, "Epic Crane Climb in Dubai" has garnered over 100,000 views on YouTube.

This isn't the first time Kingston is detained in the emirate. In 2014, he was taken in after scaling the city's second-tallest skyscraper. 

He was eventually released without charge at the time. 

The incident comes just weeks after 23-year-old Russian model Victoria Odintcova caused quite a stir after posting a video of her hanging off the Cayan Tower in Dubai.

The model was taken in for questioning by the Dubai police, where they asked her to sign a pledge "not to put her life in danger again," according to The National.