Like any good mystery, Anthony Horowitz's "A Line to Kill" has a gripping story, quirky characters who might be devious or might be innocent, a twisty plot, an enigmatic detective and a memorable setting.

But it also has something else: sly humor, most of it at the expense of the author.

"A Line to Kill" is the third in a series of mysteries that feature Horowitz as himself — or, more precisely, as an exaggerated, comic version of himself.

Horowitz is a bestselling British author, creator of the BBC television shows "Foyle's War" and "Midsomer Murders" and the author of the popular Alex Rider novels for teens.

The fictionalized Horowitz is all of those things — as well as a little pompous, a little overly confident, a little vain and wholly unable to solve any mystery despite having written dozens of them. He also has a lot of trouble keeping his mouth shut.

The enigmatic detective is a man named Daniel Hawthorne, a former detective inspector who left the force under murky circumstances — a known pedophile he was questioning fell down a flight of stairs (or was he pushed?) and was badly injured. But Hawthorne is brilliant and can solve crimes nobody else can crack, and he's in great demand as a private investigator.

In the first book in this series, "The Word Is Murder," Hawthorne suggested that Horowitz (whom he calls "Tony," perhaps innocently, perhaps to needle him) shadow him while he investigates a murder and then write a book about it; they would split the proceeds. This was the premise for the second book, as well, "The Sentence Is Death."

In "A Line to Kill" both men are invited to a writers festival on Alderney, one of the Channel Islands off the coast of England, despite the fact that Horowitz is way behind schedule with his manuscript and they have no book to promote.

The other writers at the festival are not exactly household names — a children's writer, a French poet, a blind psychic, a dreary historian and a yammering TV chef with a cookbook to hawk.

"I haven't heard of any of them," Horowitz grumbles.

The festival organizer explains, "We invited lots of famous authors — Philip Pullman, Val McDermid, Jacqueline Wilson, Alexander McCall Smith — but they all turned us down." Sorry, Tony.

Once on the island, the writers gather for a glittering party at the Gatsby-esque home of the local millionaire mover and shaker, a handsome, swaggering man named Charles le Mesurier. "This wasn't just a home," Horowitz notes. "It was a monument to himself."

Le Mesurier is one of the prime backers of a planned power line that will run from France to England, cutting across the island, destroying graveyards and homes, endangering wildlife — and making him piles of money.

So when le Mesurier is murdered a few pages later, it's anyone's guess who did it — there is, as the title suggests, a whole line of people waiting their turn to off him.

Horowitz (the real one) has a lot of fun with this book, dropping clues and red herrings, unraveling the story slowly, ending it — and then ending it again. Along the way he pokes fun at writers and readings and literary festivals and, most of all, at himself. Seriously, get in line for this one. It's terrific.

Laurie Hertzel is the Star Tribune's senior editor for books. @StribBooks Email:

A Line to Kill

By: Anthony Horowitz.

Publisher: Harper, 375 pages, $27.99.