(CNN) -- There's nothing like getting stuck into a good book -- but getting stuck in a good book store is a different matter.

Just ask David Willis, a tourist from Texas who was inadvertently locked inside a London retailer for several hours, after strolling in minutes before the store was closing.

Willis, from Dallas, entered the Waterstones store near London's Trafalgar Square on Thursday evening to use the store's WiFi.

"I walked into the store about five minutes before 9 p.m.," he told the UK's ITV television network.

"I walked in right past employees and I needed to use the internet... I peeked up on the second floor and saw there were chairs and a table up there so I walked up there and was using the internet for 10 or 15 minutes and all the lights were on upstairs.

"I get ready to leave and I walk down and it's completely dark and the doors were locked."

Willis said despite setting an alarm off by trying to open the doors and speaking to a security guard and police via telephone, no one came to his aid.

After several hours of waiting, he took to social media to broadcast his plight, posting on Twitter and Instagram.

That did the trick. As his messages were retweeted thousands of times, a Waterstones employee spotted them and secured his release.

The bookstore posted its own Twitter message shortly afterward, announcing: "We're pleased to announce that @DWill_ is a free man once more. Thanks for your concern and tweets!"

After three hours in captivity, Willis followed that with his own Twitter declaration: "I'm free".

Speaking the morning after his ordeal, Willis told ITV: "I'm very tired, I did not sleep very much last night but it feels good to be free."

READ MORE: The world's coolest bookstores