Fox has ordered crime drama “Backstrom” to series from “Bones” creator Hart Hanson, with Rainn Wilson attached to star.

From 20th Century Fox TV, “Backstrom” centers on Detective Everett Backstrom (Wilson), an offensive, irascible detective who tries and fails to change his self-destructive behavior. Throughout the series, Backstrom leads his team, the Serious Crimes Unit, as they navigate Portland’s most sensitive cases.

Fox has given a 13-episode order to the project based on Swedish scribe Leif G.W. Persson’s book series of the same name. Hanson will exec produce “Backstrom,” and Wilson will receive a producer credit in addition to toplining the drama. Persson and Niclas Salomonsson will also exec produce. Mark Mylod helmed and executive produced the pilot.

“Backstrom” was initially seated at CBS, where the Eye offered the project a pilot order early last year. Drama never gained series momentum at CBS, however, and Wilson leaked the sizzle reel for the failed “Backstrom” pilot online in the fall before Fox picked the project up to series this month.

Here's a sizzle reel for Backstrom-a pilot I did for CBS. It's in pilot limbo-land but maybe it'll be on TV one day! http://t.co/vfIaod4Ser — RainnWilson (@rainnwilson) September 9, 2013

“I couldn’t be more thrilled to get a chance to dig into Detective Everett Backstrom,” Wilson said in a statement. “For an actor it’s rare to get a crack at a role of such intelligence, humor and complexity. He’s a delightfully disheveled misanthrope with a twisted, brilliant mind and a heart of barbed wire…Fox is the perfect home for this fun and disturbed piece of entertainment. They are passionate about the show and I’m ecstatic to be working with (Fox’s) Kevin Reilly again (he launched ‘The Office’ on NBC and fought tooth-and-nail for us to stay on the air, let’s not forget) and to be on the same network as my frenemy, Mindy Kaling.”

Reilly added, “Hart Hanson and Rainn Wilson are the perfect combination of creative vision and on-screen talent to bring this one-of-a-kind character and story like ‘Backstrom’ to Fox. I’ve been in business with Hart for a long time, and not only does he have a rare gift for infusing darker themes with relatable humor, he’s one of the best showrunners out there today. Together with Rainn – who absolutely nails this role and makes it a classic Fox character – I think we’ve got something really special here.”

Follow all of the pilot season development activity through Variety.com’s Pilot Scorecard.