Producers Will Ferrell and Adam McKay received an order for six episodes for the first season from HBO. The series was produced by Will Ferrell's production company, Gary Sanchez Productions. The show premiered February 15, 2009, at 10:30 p.m. Its second season, consisting of seven episodes, began on September 26, 2010. On October 27, HBO announced they were renewing the show for a third season. At PaleyFest 2011, it was announced that the third season, which premiered on February 19, 2012, would be the last.[6] However, on July 2, 2012, it was announced that HBO had picked up the comedy series for a fourth season, which consisted of eight episodes.
On June 6, 2013, HBO announced that the fourth season would be the show's last. The fourth season premiered on September 29, 2013, and ended its run on November 17, 2013."
See more
@Wikipedia
More info...
HBO