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, [[StartsStealthilyEndsLoudly 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/MaiHime'', 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]]* In ''Film/WhoAmI'', the hero breaks into the university to get hold of the exam questions. Upon completing the data download in the server room, a guard appears out of nowhere. Busted!

[[/folder]]

[[folder: Live Action Television ]]

* This trope is particularly favoured by ''Series/{{Alias}}'', which does it almost OnceAnEpisode.* Happens on occasion in ''Series/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?* ''{{VideoGame/Thief 2014}}'' You can walk around undetected for most of the levels and then after reaching your primary goal someone spots you to add some tension to the level.** The Thief Taker General is really good at this. In the Prologue, you are spotted by the Thief Taker General on the roof during the ceremony. In Chapter 2, as soon as you break the vault and get the ring you came for, the Thief Taker General comes through the door. He will come after you both in the Keep's vault and when stealing the Primal Shard on the Baron's Mansion, though he shows signs of expecting you.** In Chapter 3, the guards discover that you used the secret passage in the House of Blossoms just after you get the book you came for.** In Chapter 4, the guard barges through the door the instant you get the Keep's blueprints.* This is why there's always an element of luck to playing a Spy in ''VideoGame/TeamFortress2''. You can put on a flawless disguise so that the opposing team doesn't give you a second glance as you slip past them, you can plan your infiltration route through back passages and rarely-used hallways, and then you turn a corner and blunder into some noob who's gotten lost in his own base.* The sole programmed JumpScare in ''VideoGame/BioshockInfinite'' takes this form in [[BedlamHouse Comstock House,]] where you have to silently manveuver through undetected by the Boys of Silence, [[HellIsThatNoise who screech horribly if they find you,]] signaling {{Mooks}} to go after you. Upon reaching a security console to open a locked door, you pull the lever, watch as the door opens on the security feed, turn around then an unavoidable Boy of Silence screams ''standing right behind you''. Note that it is nowhere in the room before switching off the security, and it is completely unavoidable.

[[/folder]]

[[folder: Web Original ]]

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