You wake up one morning.

Everything looks the same. Then you speak to your family. There's something different about them, something you can't quite place. You go out into the street and realise everyone else is acting weird too. The place you live in and the people who live in it with you have changed and some of them might even be out to get you.

All of that is a pretty familiar set-up in fiction: The Prisoner did it, Day Of The Triffids did it, as did The Waking Dead, The Twilight Zone, Invasion Of The Body Snatchers and countless other books, films and television shows. And they do it because it is a terrifying idea: the familiar becomes the unfamiliar; your friends and family become your enemies; the place you run to becomes the place you are running from.

Wayward Pines (Thursday, FOX, 9pm) uses the same basic premise, in this case based around a US Secret Service agent played by Matt Dillon who wakes up in a town in Idaho and realises pretty quickly that his friends are not what they were and that the usual figures of authority are also not to be relied on - nurses don't care, doctors don't treat, police officers don't protect. After years of tension over the way America is policed, it's easy to see where this angst and suspicion of authority comes from - a uniform is no guarantee that the person wearing it can be trusted.

Wayward Pines plays with this idea best with the sinister character of Nurse Pam (Melissa Leo) who's the first person Dillon's character Ethan Burke meets when he wakes up in hospital. Burke appears to have been hurt in a car crash but Nurse Pam isn't much interested in making him better; instead she prepares him for an operation that he doesn't need and seems to be part of some mysterious conspiracy to keep him a prisoner.

At one point, he does manage to escape, only to come up against an electrified fence that seems to surround the town and it's here that the parallels with The Prisoner are most obvious. In that famous series, Patrick McGoohan was a government agent sent to a strange community from which there was no escape; in Wayward Pines, Matt Dillon is a government agent sent to a strange community from where there is no escape. You get the idea: Wayward Pines is not very original.

But the similarities to The Prisoner are not as strong as the similarities to two other shows: Twin Peaks and Lost. In the early 1990s, Twin Peaks explored the idea of the rot and seediness that lie under small-town respectability, and Wayward Pines delves into similar territory. By day Wayward Pines looks like a tourist information film; by night it looks like a horror movie. At any point, the residents could also rip off their nice, smiley masks and reveal the lascivious, murderous faces underneath.

The similarities with Lost are also strong. That show was set on an island where nothing appeared to make sense and where time did not always follow a straight line, and Wayward Pines does something similar. At one point, Burke meets an old friend who tells him she has lived as a housewife in Wayward Pines for 12 years even though he was working with her in the secret service just five weeks before. In this town, facts that contradict each other can both be true.

However, the similarity between Lost and Wayward Pines also highlights a problem. Lost had a superb opening episode because it broke all the rules of logic and sense and made us want to know how it could possibly hang together, and Wayward Pines has done the same with its opener, which is tense and bizarre and keeps its fingers tightly round your wrist and a little round your neck.

But Lost also proved how hard it is to maintain the promise of an opening episode - and now Wayward Pines faces the same test. The first episode is a question - the success of the series will depend on the answers.