The Departed is a 2006 American crime thriller film directed by Martin Scorsese and written by William Monahan. It is a remake of the 2002 Hong Kong film Infernal Affairs and is also loosely based on the real-life Boston Winter Hill Gang; the character Colin Sullivan is based on the corrupt FBI agent John Connolly, while the character Frank Costello is based on Irish-American gangster Whitey Bulger. The Departed stars Leonardo DiCaprio, Matt Damon, Jack Nicholson, and Mark Wahlberg, with Martin Sheen, Ray Winstone, Vera Farmiga, and Alec Baldwin in supporting roles.
The film takes place in Boston. Irish Mob boss Francis "Frank" Costello (Nicholson) plants Colin Sullivan (Damon) as a mole within the Massachusetts State Police; simultaneously, the police assign undercover state trooper William "Billy" Costigan (DiCaprio) to infiltrate Costello's crew. When both sides realize the situation, Sullivan and Costigan each attempt to discover the other's identity before they are found out.
The Departed was a critical and commercial success, and won several awards, including four Oscars at the 79th Academy Awards, for Best Picture, Best Director, Best Adapted Screenplay, and Best Film Editing, becoming Scorsese's first win for Best Director; Wahlberg was also nominated for Best Supporting Actor.
In South Boston in 1986, Colin Sullivan is introduced to Irish Mob boss Frank Costello. Twenty years later, Sullivan has been groomed as a mole inside the Massachusetts State Police and joins the Special Investigations Unit, led by Captain Ellerby. Another recruit, Billy Costigan Jr., is approached by Captain Queenan and Staff Sergeant Dignam to go undercover and infiltrate Costello's crew. They set up a cover; he serves time in jail on a phony charge and eventually joins Costello's crew. Ellerby informs Special Investigations that only Queenan and Dignam will know their operatives' names and that Costello's crew has stolen computer microprocessors to sell to a Chinese gang. Due to being undercover, Costigan's emotional state declines, but Queenan and Dignam plead with him to keep his cover.
Sullivan begins a romance with police psychiatrist Madolyn Madden, whom Costigan sees professionally as part of his probation. The MSP prepares to catch Costello selling the microprocessors, but the deal takes place off-camera, allowing everyone to escape. Costello realizes there is a rat and tasks Sullivan to uncover his identity; Sullivan asks for information to cross-reference his crew members in the MSP database. Meanwhile, Costigan learns that Costello is an FBI informant, and Costello accuses Costigan of being a rat, which he denies. Costigan shares his discovery with Queenan and warns that Costello is aware of a mole in his crew.