The Departed (2006) ending / spoiler
A deal goes bad and all the goons apart from Costello and Billy are killed. Colin catches up with Costello and is angry with him about being an FBI informant. Costello goes for his gun bu Colin shoots him first. Colin takes the praise for Costellos take down and comes back to the office to find Billy waiting for him, the last survivor of Costellos group. Billy, unaware that he is talking to the rat, says that he has been undercover fro a long time. Colin tells Billy he's going to recommend him for a medal. He then goes out for a second. Billy then discovers the citizens trust envelope that Costello gave to Colin earlier. realisibng Colin is the rat and that he is probably intending to kill him, Billy leaves. He then gives an envelope to Colins girl, presumably containing evidence of Colin being the rat. Se then reveals to Colin that she is pregnant, although the baby is probably Billy's. She then finds a recording in the mail, containing a conversation Colin had with Costello. She realises he was working for Costello. Colin gets a phonecall from Billy saying to meet him at the building where Queenan was killed. There, he attempts to arrest Colin with the help of Brown, but Barrigan turns up and kills both Billy and Brown. Barrigan was also working for Costello. He lets Colin go, who, when his back is turned, shoots him in the head. Billy has a policeman's funeral, meaning he finally got his identity back, like he wanted. Colin goes home to his apartment, only to find a visitor waiting for him...Dignam. Presumably he was given the evidence of Colin's treachery by his own girlfriend. Colin kind of accepts that Dignam is going to kill him. Dignam shoots him and leaves. the final shot is of Colin lying in a pool of his own blood and the camera panning up to reveal a single rat overlooking the view of Colin's apartment.
Submitted by jezzy t