Infernal Affairs () is a 2002 Hong Kong crime drama film directed by Andrew Lau and Alan Mak from a screenplay written by Mak and Felix Chong. The film stars Andy Lau, Tony Leung, Anthony Wong, and Eric Tsang. The film follows an undercover Hong Kong Police Force officer who infiltrates a triad and another police officer who is secretly a spy for the same triad. The film is the first in the Infernal Affairs series, followed by Infernal Affairs II and Infernal Affairs III (both 2003).

At the 22nd Hong Kong Film Awards, Infernal Affairs won seven out of the sixteen awards it was nominated for—including Best Film, Best Director, Best Actor (Leung), and Best Supporting Actor (Wong). It also won in those categories at the 40th Golden Horse Awards and 8th Golden Bauhinia Awards. The film was selected as Hong Kong's entry for the Best Foreign Language Film at the 76th Academy Awards but was not nominated. Miramax Films acquired the United States distribution rights and gave it a limited American theatrical release in 2004.

American director Martin Scorsese remade the film in 2006 as The Departed, which won the Academy Award for Best Picture as well as Academy Award for Best Director, Scorsese's first and only Oscar in his career, and Best Adapted Screenplay. The film has also been remade in India as Homam (2008), in South Korea as City of Damnation (2009), and in Japan as (2012). In 2018, a television series adaptation aired on TVB.

Plot Hon Sam, a Hong Kong triad boss, sends Lau Kin-ming, a young gangster, to the police academy to become his mole in the Hong Kong Police Force. Around the same time, cadet Chan Wing-yan is ostensibly expelled from the police academy, but is actually selected to be an undercover cop reporting only to Superintendent Wong Chi-shing, who sends him to infiltrate Hon's triad. Over the next ten years, Chan becomes increasingly burdened by the psychological strain of maintaining his undercover identity. Meanwhile, Lau quickly rises through the ranks, becoming a Senior Inspector.

After successfully infiltrating the triad, Chan informs Wong of a transaction between Hon and some Thai cocaine dealers, which Wong's team interrupts. However, Lau alerts Hon, giving him enough time to get his henchmen to dispose of the evidence. After this incident, Wong and Hon realise they each have a spy within their own organisations, and race each other to uncover the moles. By this time, both Chan and Lau are struggling with their double lives. Chan is afraid he is turning into an actual criminal while also fearing his cover will be blown; he begins undergoing sessions with psychiatrist Lee Sum-yee and jokingly tells her that he is a cop. Meanwhile, Lau appreciates his life as a respected police officer and wants to sever his ties with the triad.

Lau is tasked by Hon to identify the cop who infiltrated the triad; coincidentally, he is also assigned by the HKPF to lead the mission to uncover the triad's mole within their ranks. He uses his new role to have Wong surveilled, hoping to catch him meeting his mole. Wong meets Chan on a rooftop to discuss Hon's next drug shipment as well as Chan's fear of being uncovered. Hon learns about Wong's location from Lau and sends his henchmen to confront them. Chan escapes from the building while Wong tries to distract the gangsters but ends up being thrown off the roof to his death. Just then, the police show up and a shootout ensues. Henchman Keung, unaware that Chan is the mole, chauffeurs him away from the scene but succumbs to a gunshot wound he sustained earlier. When the news reports that Keung was apparently an undercover cop, Hon assumes he was the mole. Using Wong's phone, Lau contacts Chan and convinces him to collaborate in taking Hon down. The police successfully foils Hon's subsequent drug deal and arrests his henchmen. Lau then betrays Hon and kills him.

Everything seems to have fallen into place—Chan can revert to his true identity as a cop while Lau has erased his criminal connections. At police headquarters, Chan and Lau meet for the first time. As Lau prepares to reinstate Chan into the police force, Chan deduces that Lau was the mole and leaves promptly. Realising what had happened, Lau takes possession of Chan's police identity file to use as leverage to dissuade Chan from exposing him. Chan meets with Lee, the only person left whom he can trust, and convinces her that he truly is a cop. Chan then sends a CD to Lau's address containing a recording of Lau's earlier meeting with Hon. Lau's fiancée, Mary, inadvertently listens to the CD and discovers Lau's secret. Chan arranges to meet with Lau on the same rooftop where Wong was killed. There, he disarms Lau and points a pistol to his head. Lau states calmly that he wants to start over as a good person, but Chan rejects his plea to help him conceal his criminal past. Inspector "Big B" arrives and points his gun at Chan, ordering him to release Lau. Chan holds Lau hostage at gunpoint and backs into a lift, but is shot in the head by Big B. Big B then reveals to Lau that he is also a mole planted by Hon, and assures Lau of his loyalty. When they ride the lift down to the ground floor, Lau kills Big B.

Six months later, Lee discovers records of Chan's identity as an undercover cop and he is buried with honours beside Wong. Lau salutes Chan at his funeral. Meanwhile, the internal affairs case is closed after they conclude that Big B was the mole in the police force. A flashback shows the day that Chan was ostensibly expelled from the police academy, with Lau looking back with guilt and wishing he was the one expelled instead.

Alternate ending An alternate ending for the film was shot in order to comply with Article 25 (7) of the Chinese Film Administration Regulations specifying that films cannot propagate obscenity, gambling or violence, or abet to commit crimes.S. Xu (2017) "The Curious Case of Chinese Film Censorship: an Analysis of the Film Administration Regulations". School of Journalism and Communication and the Graduate School of the University of Oregon. 32-44. In the original Hong Kong ending, Lau concealed his true identity as a triad spy and identified himself as a police officer to avoid punishment. Therefore, the original ending was deemed to promote criminal activity and injustice, and an alternate ending was filmed to make the film suitable for mainland China. In the alternate ending, Inspector Cheung discovers evidence of Lau's criminal activity and immediately arrests him when he gets off the lift. This alternate ending was shown in mainland China and Malaysia.H. Y. F. Choy (2007) "Schizophrenic Hong Kong: Postcolonial Identity Crisis in the Infernal Affairs Trilogy". Transtext(e)s Transcultures. 3: 52–66. https://doi.org/10.4000/transtexts.138

Cast Andy Lau as Senior Inspector Lau Kin-ming (), Hon's mole in the Hong Kong Police Force. Lau served his triad boss while also valuable in the police force. He later attempted to clear his name and become an upright police officer. Edison Chen as young Lau Kin-ming. Edison Chen as young Lau Kin-ming Tony Leung as Chan Wing-yan (), an undercover cop in Hon's triad. Shawn Yue as young Chan Wing-yan Anthony Wong as Superintendent Wong Chi-shing (), Chan Wing-yan's superior. He is one of the few who knows Chan Wing-yan's true identity. Eric Tsang as Hon Sam (), the triad boss. He planted Lau Kin-ming in the police force as his own undercover agent. Chapman To as "Silly" Keung (), one of Hon Sam's henchman. Gordon Lam as Inspector B (大B; Big B), Lau's subordinate, who is later revealed to be another mole planted by Hon Sam. Sammi Cheng as Mary, Lau's fiancée. She didn't know Lau's secret identity at first, but gradually discovered it and was disappointed. Kelly Chen as Lee Sum-yee (), Chan's psychiatrist. She is one of the few people Chan trusts with his real identity. Berg Ng as Senior Inspector Cheung (), Wong's subordinate. Wan Chi-keung as Officer Leung (), the Chief Superintendent of the Internal Affairs department. Dion Lam as Del Piero (), Hon's henchman. Elva Hsiao as May, Chan's ex-girlfriend. Hui Kam-fung as Officer Yip (), Chan's cadet school principal

Production Writing Writer Alan Mak had long wanted to write a story about police and gangsters. The script of Infernal Affairs was inspired by John Woo's Face/Off (1997) but Mak knew that its science fiction elements were too implausible in reality, so he focused on the exchange of identity and psychology between the two leads as its themes. Additionally, Mak wanted to explore the idea of triad members going undercover within the police, which had not been the plot of a movie prior to the release of Infernal Affairs. In the process of Mak's creation, his good friend Felix Chong also encouraged and supported him. The script, written by Mak and revised by Chong, took three years to complete.

The dialogue in the famous rooftop showdown was created on the spot by Felix Chong and Tony Leung, with Chong playing Andy Lau's part. The script originally included a typical shootout in the third act, but Leung insisted on turning it into a dialogue scene.

Gordon Lam did not receive the full script and did not know his character was also a triad mole until the final scene.

Investment The script for Infernal Affairs originally belonged to Andy Lau's Teamwork Motion Pictures, but due to the company's entanglement in a lawsuit at the time, it was unable to produce the film. In addition, the creative team lacked investors because other studios viewed a gangster film as no longer novel or profitable. This hesitation reflected broader industry tensions. Professor Gina Marchetti noted that Hong Kong filmmakers like Lau experienced fierce competition from emerging Hollywood, while also battling widespread DVD and VCD piracy. Eventually, Andrew Lau made a hopeless bid and showed the script to John Chong at Media Asia Entertainment Group. To his surprise Chong and company chairman Peter Lam saw potential in the story. Lam proceeded to invest HK $20 million in the film, under the condition that Andy Lau will star the film. In total, the budget for the movie ended up being HK $50 million, with over half going into production costs to amplify the quality of the film. This allowed for the usage of a full orchestra for the score of the film, as opposed to a synthesizer, which marked the first time a full orchestra was used in Hong Kong cinema.

Themes Postcolonial identity crisis in Hong Kong In Infernal Affairs, the identity crisis suffered by both Chan and Lau as moles hint at the struggle of Hong Kong residents, who faced both the colonization by the British and the reunification with Mainland China. Specifically, under Deng Xiaoping's one country, two systems policy, the duplicity, unsettling, and uncertain nature of the future of Hong Kong residents is tightly echoed in Chan and Lau's character developments. Scholar Howard Y. F. Choy further claimed that "this postcolonial (re)turn is actually more a recolonization than a decolonization of the capitalist Cantonese city by the mainland Mandarin master." The 2003 prequel, Infernal Affairs II, features the Hong Kong handover much more directly in the main plot.

Director Andrew Lau himself has asserted that the movie is "quite political", but rather by portraying the handover at all, as well as a society with a corrupt police force and inescapable triad presence, as such depictions "would cause a lot of controversy in China."

Lau has claimed that while growing up in Hong Kong, he was told by his parents that "a good guy cannot be a policeman" and reflected on his identity at the time by adding "As a child and in high school I didn’t like Hong Kong because it was a British colony. The British people controlled the Chinese people. That was my feeling. At that moment, I was thinking, “No matter what, you’re Chinese.”"