At its simplest form, a character reveals himself to be an undercover police officer, FBI agent, what have you. Often, he's acting as a ReverseMole, trying to get enough evidence on the villain to arrest him for ArsonMurderAndJaywalking. It's entirely possible that we, the viewers, won't find out until the rest of the characters do as well. Depending on what side of the SlidingScaleOfIdealismVersusCynicism, this may or may not end badly for the cop.
----
!!Examples:

[[foldercontrol]]

[[folder: Anime And Manga ]]

* One Sinnoh-era ''{{Anime/Pokemon}}'' episode had one of these with an undercover Officer Jenny. There was a possible vague hint with Brock going into his usual routine when the group met her,but it was still hidden fairly well.

[[/folder]]

[[folder: Comic Books ]]

* Done twice in "A Night at the Rose Petal" in ''TheMazeAgency Annual'' #1.
* Happens twice in the ''ComicBook/ChickTracts''. In "Bad Bob," Bob and his cousin deal drugs, and find out their buyer is a cop when he reads them their rights. In "Trust Me", the kid, to fund his drug habit, sells drugs to an undercover cop with a briefcase full of money, resulting in the cop pulling out a pistol and a badge, which is less surprising than most examples of the trope because he gets down on his knees and says "[[TitleDrop Trust]] [[SchmuckBait me]]!".
* Happens in ''TheSimpingDetective'''s pilot strip ''Gumshoe''. Jack is working Angeltown as a PrivateInvestigator and is coerced into a back alley by a client, where he is accosted by ninjas. When he takes them down, the client gets the drop on him. He reveals that it was a feint and pulls out his badge, as his backup arrives.

[[/folder]]

[[folder: Fan Fic ]]

* In the ''FanFic/AlvanAnTheChipmunks3TheSecondSqueakuel'', [[spoiler:SnoopDogg]] turns out to be a member of the police.

[[/folder]]

[[folder: Film ]]

* ''Film/ReservoirDogs'': Mr. [[spoiler:Orange]], just after killing Mr. [[spoiler:Blonde]].
* In ''TheFastAndTheFurious,'' Brian O'Conner reveals to Mia that he is a cop at the end of the movie. The viewer has known this all along but it allows some drama between O'Conner and the girl he has been sleeping with and [[spoiler:eventually persuades her to help him track down the truck thieves]].
* ''RunningScared'' (1986). When detectives Hughes and Costanzo try to arrest Gonzales and end up caught in an ambush, two of Gonzales' men reveal themselves as undercover cops Montoya and Sigliano and save the {{heroes}}' lives.
* In ''Film/BlackDog'', [[spoiler: Sonny]] reveals to Crews that he is an FBI agent after he is mortally wounded in a truck-jacking attempt.
* In the final ending of ''Film/{{Clue}}'', [[spoiler:Mr. Green]] reveals himself as an FBI agent, just after shooting [[spoiler:Wadsworth who is the real Mr. Boddy]].
* At the end of ''Film/TheSpanishPrisoner'', Joe is saved by [[spoiler: a pair of Japanese tourists]] who turn out to be undercover U.S. Marshals who have had Jimmy's con under observation since the start.
* [[spoiler: Roz]] in ''WesternAnimation/MonstersInc'' turns out to be an undercover agent of the CDA. And not just an undercover agent, [[spoiler:but the head of the whole freaking organization!!]]
* In ''Film/TheWholeNineYards'' [[spoiler:the assassin the cheating wife hired to kill Oz was actually a cop recording their conversations. He wasn't outed until after being killed by Jimmy, scaring Oz's wife away]].

[[/folder]]

[[folder: Literature ]]

* In Creator/RobertAHeinlein's ''Literature/MagicInc'' the heroes are helped by an UndercoverCopReveal when, essentially, fighting the literal forces of Hell. An FBI agent masquerading as a demon.
* In ''Discworld/{{Maskerade}}'' it's setup to look like Andre might be the villain until he reveals that he is actually an undercover cop.
* ''TrickyBusiness'', a rare non-humor book by DaveBarry (although it does have it's moments), is about an illegal casino ship that is also a base for drug dealers, things go wrong, etc. On of the POV characters is a pretty young lady who works as a cocktail waitress, hates her job, and her mother always tells her to quit because it's so dangerous... Makes perfect sense, until the very last part of the book when it's revealed that "cocktail waitress" was just a disguise: she is actually a badass undercover cop, and now everything suddenly sounds a lot smarter.
* TimothyZahn's not-quite-StarWars SpaceOpera-Mystery-action book ''Literature/TheIcarusHunt''. To say more would be to spoil it, though if the reader is both paying attention and actively trying to put the pieces together, it's not ''that'' hard to figure it out ahead of time.
* In the TimDorsey novel ''Hammerhead Ranch Motel'', one room at the motel holds two different drug gangs who are secretly undercover cops each of whom is trying to bust the other gang. They only discover this when a third jurisdiction of police shows up and tries to bust both of them.
* At the very end of Creator/PatriciaCWrede's ''Literature/MairelonTheMagician'', [[spoiler:William Stuggs, Jasper Marston's apparently dim-witted henchman]], calmly reveals himself to be a Bow Street Runner. This is helpful, as it means he's witnessed the entire climax and has no uncertainty about who to arrest.
* Cyrus Hardman in {{Literature/Murder on the Orient Express}} is a PinkertonDetective posing as a TravelingSalesman.

[[/folder]]

[[folder: Live Action TV ]]

* ''Series/{{Angel}}'': Kate in her first appearance ("Lonely Hearts").
* Turned UpToEleven in a sketch in ''DoNotAdjustYourSet''. The undercover cop reveals himself to be one to a gang, now that he's got enough evidence to convict them...[[FlockofWolves and then ''all of them'' turn out to be undercover cops.]]
-->'''Jenkinson:''' Blimey...we're all coppers...
-->'''Johnsson:''' ...So what do we do now?
-->'''Leader:''' ...Jenkinson, can you blow up a safe?
* ''{{Fastlane}}'' episode "Mighty Blue". When officers Van and Deaq confront a criminal gang, one of them reveals herself as an undercover police officer to save them.
* This happened to Sawyer in the "flash-sideways" on ''{{Lost}}'' - the scene deliberately echoed a season one flashback which showed him as a con man, only this time the mark called him on it, and he revealed that he was a cop.
* In the ''Series/DoctorWho'' story "[[Recap/DoctorWhoS14E5TheRobotsOfDeath The Robots of Death]]", one of the Sandminer's crewmembers is revealed to be an undercover agent -- and [[spoiler:so is one of the robot drones, which is actually a highly advanced robot disguised as the most primitive and stupid model in use on the Sandminer]].
* Occurs in the first episode of ''Series/RookieBlue'', even though he tries to keep his cover even after being arrested. Its finally blown when an old friend greets him heartily as he is about to be processed.
* Happens in the episode of ''Series/TheBill'' that re-introduced Frank Burnside. Burnside was undercover with a gang of soccer hooligans that are busted by Sun Hill. Burnside headbutts one of the arresting officers to maintain his cover.
* ''Series/HawaiiFive0:'' Sid in "Mala Ka Aina"; Kono in "Ma'eme'e"
* Liam in ''Series/TheChicagoCode''
* In ''{{Suburgatory}}'', a student that Tessa assumed to be gay actually was an undercover narcotics agent.
* One episode of ''VeronicaMars'' involved a suspected plot to bomb the school. One of the prime suspects turned out to be an undercover ATF agent[[note]] Invoking an in-universe version of DawsonCasting, no less[[/note]] who was hoping to draw out the real bomber by making himself out to be a kindred spirit.
* Michael Weston planned to do this in an episode of ''Series/BurnNotice''. While trying to score points with the boss of a gang, he sets up TheDragon to look like an undercover cop and then be the hero when he exposes him. Since the guy had no problem destroying valuable property just to scare people, Michael didn't feel too bad for the guy. [[spoiler: Turns out he actually was undercover. Oops.]]
* This trope has been used at least once on ''Series/{{Castle}}'', and probably several times. The protagonists are investigating a murder and an early suspect turns out to be an agent of the FBI or ATF who was investigating the victim (or employing the victim somehow, or investigating or another suspect) for their own reasons.
** The murder of a dog show judge leads the cops ([[AndZoidberg and Castle]]) all over the place. Eventually, they find a warehouse, where the victim's assistant claims that the guy was trying to cross-breed dogs. After digging around, they start to suspect that the victim was involved in bringing drugs from South America. They confront the "assistant", who immediately tells them that they will, in fact, find drugs hidden in the warehouse. He's a US Customs agent. The victim was employed to train drug-sniffing dogs (hence the drugs and the $10,000/month money transfers).
** Ryan does this in-universe in "The Wild Rover". If the audience didn't already know, that ending would've been pretty impressive.
* A mild version in ''Series/LieToMe'' where Foster starts dating a high school guidance councillor, only to get strange vibes from him. She then finds passports with different identities and evidence of drugs. After she confronts the guy about it, he admits that he's DEA, sent to uncover a school trafficking ring. He later reveals it to Cal as well, given that Cal can't help but stick his nose in other people's business.
* An episode of ''TheFamousJettJackson'' shows an episode of the ShowWithinAShow ''Silverstone'', where all the world's bad guys are invited to a remote mansion by a mysterious new villain named Mr. Kilimanjaro. Throughout the dinner, they start arguing and trying to one-up each other, revealing all their recent and latest plots. It turns out that the whole thing was a setup by Silverstone (in disguise as Kilimanjaro) to get recorded confessions from these guys and grab them all at once.
* On ''Series/NCISLosAngeles'' Eric Christian Olsen's first appearance is as an MMA fighter and suspect called Jason Wyler. It's not until half way through the episode that Hetty reveals that he is Detective Marty Deeks, undercover.
** All the team members are highly trained and experiences in undercover work so this happens in-universe fairly often. Since they hate burning a cover identity, they will try to delay the reveal as long as possible. One of Callan's old girlfriends spent years believing that he was her brother's criminal friend who had to leave town after the cops got too close.
* In episode 4 of series 1 of ''Series/DeathInParadise'', the MsFanservice in a group of treasure hunters turns out to be an investigator from an insurance company, which had been defrauded by the leader of the group. Camille, one of the main police officer protagonists had immediately disliked her and thought she was guilty (mainly because she caught her superior officer and [[{{UST}} potential love interest]], Richard, ogling the woman, and when the woman reveals her true identity, Camille [[InsaneTrollLogic declares that she was proven correct]].
* In one episode of ''Series/TheInvisibleMan'', Hobbes is revealed to have a history of StalkerWithACrush behavior toward his ex-wife, including suspicion of her boyfriends. He becomes suspicious of her current boyfriend, who has a criminal record, suspicions which seem to be born out when he and Fawkes catch the guy scheming with others to steal military tech and sell it on the black market. After they capture him, it turns out that he's an undercover FBI agent (and thus his criminal record is fake) and was involved in a sting operation which they [[NiceJobBreakingItHero nearly ruined]].
* ''{{Series/JAG}}'': The episode "Brig Break" has Meg Austin discover that [[spoiler: Petty Officer Quinn]] is an undercover agent for Navy Intelligence trying to infiltrate a group of gun runners. He ends up [[NoHonorAmongThieves getting killed]] by [[spoiler: Sergeant Lowell]] soon after Austin figures it out.
* On ''Series/PersonOfInterest'' one [=PoI=] is a robber who seems to be planning to murder a police officer. Reese sees the criminal breaking into the cop's house and is about to intervene when the cop's wife opens the door and greets her husband. The [=PoI=] is undercover in a gang of jewel thieves and he took some time off to see his family. Later on, the cop's cover is about to be blown so Reese outs himself as TheMole instead.

[[/folder]]

[[folder: New Media ]]

* Occurred in the skits for ''The Egypt File'' VBS. The custodian turned out to be an undercover cop on the trail of a notorious artifact smuggler, [[TheMole who had been disguised as a cop]].

%%Please don't add that one play we're not spoiling. You know the one.

[[/folder]]

[[folder: Video Games ]]

* Agent Shepherd in ''TwistedMetal: Head On'' reveals himself to be FBI rather than take a wish from Calypso.
** John Doe from ''TwistedMetal Black'' discovers that he's an FBI agent, but not until he gets his memory back after the tournament...and standing in front of the number two most wanted man in the world.
* Doll in ''VideoGame/SagaFrontier'', during Red's game when investigating Berva.
* A sidequest in ''VideoGame/FalloutNewVegas'' has you encounter a NCR Ranger in disguise as he runs a sting on a crooked quartermaster. He reveals himself after you run afoul of him, forcing you to either turn in the crooked quartermaster, fast-talk the ranger, or just blast him.

[[/folder]]

[[folder: Western Animation ]]

* In one episode of ''DogCity'', the villain is posing as a school teacher to get into a mint under the cover of a field trip. He is thwarted when it turns out that only two of his students are ''not'' undercover cops.
* In the ''WesternAnimation/BatmanTheAnimatedSeries'' episode "Almost Got 'Im", as several of Batman's villains play poker at a seedy bar and exchange stories on how they had nearly killed Batman, Joker announces that he had just kidnapped Catwoman and was holding her at an abandoned catfood factory, where he planned to have her killed. Killer Croc then punches out Joker, and the other thugs discover that Croc is really Batman in disguise. When they decide to take him out, ''[[CrowningMomentOfAwesome every other patron of the bar]]'' turns out to be a cop. The gathered cops, led by Commissioner Gordon and Detective Bullock, take down the villains, leaving Batman free to save Catwoman.
* Often happens in ''Franchise/ScoobyDoo''. They usually are working to take down the supernatural threat, but the kids usually beat them to it. Leaving the audience wondering how incompetent the officer has to be, since the target audience would be unaware of the rules of evidence required.
* The ''WesternAnimation/SouthPark'' episode "Butters' Bottom Bitch" has Sergeant Yates disguises himself as a prostitute and outs himself to all the people who hire him. At the end, he ''marries'' a pimp and they live a happy life for a year before he outs himself.
----