Deadwood is an American western television series created, produced, and largely written by David Milch, that aired on the premium cable network HBO from March 21, 2004, to August 27, 2006, spanning 36 episodes and three seasons. The series, set in the 1870s in Deadwood, South Dakota, before and after the area's annexation by the Dakota Territory, charts Deadwood's growth from camp to town, incorporating themes including the formation of communities. The show features a large ensemble cast, and many historical figures appear as characters, such as Seth Bullock, George Crook, Wyatt Earp, E. B. Farnum, George Hearst, Wild Bill Hickok, Calamity Jane, Jack McCall, Sol Star, Al Swearengen, and Charlie Utter. The plot lines involving these characters include historical truths as well as substantial fictional elements. Milch used actual diaries and newspapers from 1870s Deadwood residents as reference points for characters, events, and the look and feel of the show. Some of the characters are fully fictional, although they may have been based on actual persons.