A man has gone viral after getting locked inside a gym called 24 Hour Fitness when all the staff went home.

Dan Hill, 50, went for a late-night swim at a branch of the fitness chain in Salt Lake City, Utah, on Saturday night and emerged from the pool to find the building deserted.

Dan Hill poses in 24 Hour Fitness
Dan Hill found himself locked in 24 Hour Fitness after going for a late-night swim (Dan Hill)

“I walked around and as I started to explore further, there’s nobody there,” he told the PA news agency.

“You start feeling like that last person on Earth, like the rapture’s happened and you’re the only evil one left on Earth and everyone’s gone. Very strange feeling.”

What Mr Hill had not realised was that, despite its name, the fitness centre had recently changed its opening hours so it was closed between midnight and 4am.

The gym had two emergency exits, Mr Hill said, but because of signs warning that alarms would sound if they were opened, he decided it was safer to stay put and call the police.

He said: “First of all the person answering the phone said ‘you’re where?’ and I said ‘I’m at the 24 Hour Fitness’. He said ‘but it’s 24 hours’ and I said ‘I thought so too!’.

“He got a good laugh out of that.”

I am literally locked inside 24 hour fitness right now. They closed the doors and went home while I was swimming my laps…

Posted by Dan Hill on Saturday, January 11, 2020

While he waited for officers to arrive he took pictures of himself waiting in the gym, sending them to his wife and friends and posting them on Facebook, before settling into the hot tub.

“If you have to be locked in somewhere, a place with a hot tub is not a bad choice,” he said.

Officers eventually arrived after he had been in the gym for around two hours, he said.

With the police there he left via an emergency exit before posing for pictures with the officers.

“They went into about three or four poses trying to figure out what was best,” Mr Hill said. “I asked them to do a Charlie’s Angels pose with their guns out but they said they couldn’t do that – that would probably get them in trouble.”

He arrived home to find his wife, who had initially advised him to find a comfortable place in the gym to hunker down for the night, fast asleep in bed.

“She rolled over and said ‘oh, you got out huh?'” Mr Hill said. “She wasn’t too worried about me.”

Dan Hill poses with police
Police posed for selfies with Dan Hill after he finally emerged from the gym (Dan Hill)

Mr Hill, who has been going to 24 Hour Fitness for around 10 years, said the company had since been in touch to apologise and added: “I have no ill will towards them, they’ve been great. I’ve always been friends with the people who work there.”

PA has contacted 24 Hour Fitness for comment, but in a statement quoted by ABC News the company said: “On behalf of 24 Hour Fitness, we apologise to Mr Hill and the unfortunate experience he had in the 24 Hour Fitness Sandy club, 10365 South 1300 East, when it closed Saturday evening.”

It added: “We clearly did not do a good job of our closing procedures for this club on Saturday night and will reinforce our club procedures so that this incident doesn’t occur in the future.”

Mr Hill’s Facebook post has been shared around 10,000 times and also garnered attention on Reddit, an experience he has thoroughly enjoyed.

“I literally have not had a negative comment out of close to 20,000 comments,” he said. “Everyone’s just been laughing and giggling and having a good time about this. I’m genuinely touched.

“There are some amazing, fun people out there in the world.”