The 20-year-old spoke out after a photograph taken by a friend began circulating the internet. It showed him standing on the edge of the balcony of a London high-rise building, with the city skyline visible behind him.
According to The Sun, it was the 34th floor and 360-feet above the ground.
Liam apologised via Twitter, telling fans: "You may have seen a photo of me today taken on top of a building. I regret being there and having a photo taken. It was a stupid and irresponsible thing to do. I am sorry, and do not endorse any fans trying to repeat this, as it is extremely dangerous."
One Direction fans were quick to assure Liam they wouldn't be following in his footsteps and showed their continued support for him by circulating a Photoshopped image of the singer dressed as Batman standing on the balcony ledge.
The 'Best Song Ever' star hasn't had the easiest of weeks as he also took to Twitter to plead with fans to respect his privacy and stop congregating outside his home.
"I know my friends have tweeted a lot of pictures of my house the past few days but can people please stop coming and waiting outside," he wrote.
"I'd just like to be able to walk outside as everyone does and enjoy time with my friends, not feel bad for not wanting to take a picture. Sorry if I've been rude to anyone but I've come to realise if I take one picture more people keep coming everyday xxx hope everyone's good."