The lead character has just successfully carried out their tricky infiltration of some high-security facility and copied the information/stolen the technology/rescued the prisoner/what-have-you. Just as they're done, in wanders some random security guard, who sounds the alarm. Cue the action sequence.

Basically it's a way for a SpyDrama to have its cake and eat it too. You want to see a perfectly-executed piece of espionage, but you also want to see the lead kicking and shooting and fleeing? Throw in some nicely-timed security personnel and you can have it both ways. Although sometimes you have to wonder, did the question "What do we do about the security patrol?" never even come up during planning? In Spy Fiction, the fact that the enemy would quickly realise that their secret files had been stolen also rarely seems to come up.

Otherwise, this trope is something of an example of TruthInTelevision. It is surprising how many crimes are stopped because police or security forces happened to show up at just the wrong time for the criminals, or someone saw something and called the police.

Related to ContrivedCoincidence and possible DiabolusExMachina.

----
!!Examples:

[[foldercontrol]]

[[folder: Anime and Manga ]]

* ''Anime/{{Mai-HiME}}'', although it's subverted in two ways: first, Mikoto triggers the alarm before Mai and Natsuki even manage to get into the (abandoned) facility, and second, when the guards arrive just as the girls are leaving, Mai persuades the other two to surrender despite their readiness to fight. They later escape anyway, with the help of a conveniently-timed ambush.

[[/folder]]

[[folder: Fan Fic ]]

* ''FanFic/MassesToMasses'': Just as Ian finishes the infiltration to seize illegal organs, one random guard manages to sneak up on him and is about to get help. Instead, gets a punch to the face.

[[/folder]]

[[folder: Film ]]

* ''Film/EscapeFromSobibor'': [[spoiler: One of the guards goes into a senior officers office and discovers him by spotting blood and following its trail, marking the turning point of the escape when they had previously gotten along without widespread discovery]]

[[/folder]]

[[folder: Live Action Television ]]

* This trope is particularly favoured by ''Series/{{Alias}}'', which does it almost OnceAnEpisode.
* Happens on occasion in ''BurnNotice'', usually to the delight of the 'narrator' who always has good ideas on how to effectively deal with such a predicament.
* Happens in an episode of ''{{Series/Firefly}}''. Jubal Early meticulously maps out the crew and waits to break into the ship until after everyone is in bed or otherwise isolated and vulnerable. He then enters the airlock, turns a corner...and bumps right into Mal.

[[/folder]]

[[folder: Video Games ]]

* ''VideoGame/ShadowmasterChronicles'' parodies and subverts it.
--> ''Hay Lin: "Why not just take out a guard and blend in?"''
--> ''Dakota: "Because that's stupid. The point of espionage is to NOT BE NOTICED BY ANYONE. What if that guard had buddies? Or was invited to play poker or something?"''

[[/folder]]

[[folder: Web Original ]]

* ''RedVsBlue'' In the second episode of Season 9, when the guard catches South stealing data from the terminal.

----
<<|ActionAdventureTropes|>>