<P> In January 2003, Warner Bros., producer Brad Grey, and actor / producer Brad Pitt bought the rights to remake the Hong Kong film Infernal Affairs (2002) from Media Asia for $1.75 million . William Monahan was secured as screenwriter, and later Martin Scorsese, who admired Monahan's Boston - set, Irish - Catholic gangster script, came on board as director . </P> <P> In March 2004, United Press International announced that Scorsese would be remaking Infernal Affairs and setting it in Boston, and Leonardo DiCaprio and Brad Pitt were slated to star . Pitt, tentatively scheduled to play Sullivan, later declined in favor of using a younger actor, and continued to produce the film instead . Scorsese's associate Kenneth Lonergan suggested Matt Damon, who grew up in Boston, for the part of Sullivan, and Scorsese asked Jack Nicholson to play Costello . </P> <P> Nicholson, however, wanted the film to have "something a little more" than the usual gangster film, and screenwriter Monahan came up with the idea of basing the Costello character on the famous Irish - American gangster Whitey Bulger from Boston . This gave the screenplay an element of realism--and also an element of dangerous uncertainty, because of the wide - ranging carte blanche the FBI gave Bulger in exchange for revealing information about fellow gangsters . A technical consultant on the film was Tom Duffy, who had served three decades on the Boston Police Department, particularly as an undercover detective investigating the Irish mob . </P> <P> The film got the official greenlight from Warners in early 2005, and began shooting in the spring of 2005 . Although some of the film was shot on location in Boston, for budgetary and logistical reasons many scenes, interiors in particular, were shot in locations and sets in New York City, which had tax incentives for filmmakers that Boston at the time did not . </P>

Who is the movie the departed based on