'The Good Wife' writer Craig Turk will pen the pilot for the project, which has landed a 13-episode order.

In a surprise twist, Dick Wolf is headed to CBS.

The prolific producer behind NBC's Law & Order and Chicago drama franchises has landed a 13-episode series order at CBS for his latest drama.

The project, F.B.I. (working title), is a scripted drama about the inner workings of the New York office of the Federal Bureau of Investigation.

Craig Turk (The Good Wife) will pen the pilot and will serve as showrunner. He and Wolf will executive produce with Wolf Films veterans Peter Jankowski and Arthur W. Forney. Universal Television, where Wolf has a rich overall deal through 2020, will produce the series with CBS Television Studios. The show will launch during the 2018-19 TV season.

Wolf had previously expressed interest in doing an FBI-centered drama in 2016 when he had a similar project in development at NBC. Wolf's interest stemmed from his relationship with the bureau's then-director James Comey, whom he called "one of the most interesting people I've met in the last 10 years." (Comey has since exited his post.)

"I am big fan of the FBI," Wolf told reporters at the time. "I think they do an impossible job remarkably well. The acceptance rate is one percent. The average agent is 30 years old. It's a world that is very rich. The New York field office is the biggest FBI office in the country. It's kind of a natural for us."

Wolf also went on to produce an unscripted series centered on the FBI's New York field office, titled Inside the FBI: New York, which premiered on NBC's sister cable network USA in April.

The CBS series order is surprising given Wolf's long history at NBC, dating back 27 years to the 1990 launch of Law & Order. That drama ran 20 seasons and spawned five spinoffs, including Law & Order: SVU, which is heading into its 19th season, and the Law & Order True Crime anthology series that will launch Tuesday in the post-This Is Us slot.

Wolf also has the Chicago universe at NBC, which includes Chicago Fire, Chicago P.D. and Chicago Med. A fourth series, Chicago Justice, was canceled in May after one 13-episode season, and Chicago Med is being held this year for a midseason launch.

CBS has found success with similar procedural franchises with the NCIS shows, Criminal Minds and, until recently, the various offshoots of CSI.

The move brings Wolf back to CBS nearly 30 years after they worked together on Law & Order. After Fox originally ordered the series, and then scrapped that order, CBS ordered a new pilot for Law & Order in 1988. However, the project did not move forward and ultimately ended up at NBC, where Wolf's CBS pilot episode aired as the sixth episode of the Emmy-winning series.

While most of Wolf's scripted series have been at NBC, he has unscripted series at a variety of networks including A&E (Nightwatch) and Oxygen (Cold Justice and Criminal Confessions).

The drama order marks CBS' first new series order for the 2018-19 TV season and joins hit comedy The Big Bang Theory, which was renewed for two seasons in May.

Despite the rise of vertical integration in recent years as broadcasters look to increase ownership, CBS has continued to team with outside studios, including Universal TV, which is co-producing the forthcoming Jeremy Piven tech drama Wisdom of the Crowd. Universal TV also has scripted series at Netflix, Freeform and Hulu.

Both Wolf and Turk, whose credits also include Private Practice, Boston Legal and a 2003 episode of Law & Order, are repped by WME. Wolf is also repped by attorney Clifford Gilbert-Lurie at Ziffren Brittenham.