In many cultures, taking someone's life is considered one of the worst things you can do to a person, but there's one circumstance where it will often be considered justified: self-defense.
Enter Killing in Self-Defense, where an assailant is killed by whoever they were trying to harm. This can come in a variety of ways. Maybe the would-be victim managed to fight back and manages to kill their assailant in the ensuing struggle, or perhaps the would-be victim knew in advance that they would be targetted and took steps to outgambit the attacker. There are even cases where the victim had no intent to kill at all, and the death was purely accidental in nature. In fiction, and in real life, this sometimes results in a sentence for the Crime of Self-Defense.
If the assailant was out to kill the victim, then it's essentially Karmic Death at its finest.
Compare Assassin Outclassin', which encompasses all instances of foiled assassination attempts, and Guilt-Free Extermination War when this applies to large groups or entire species. Compare also Counter Attack, especially for Video Games. Also see Inconveniently Vanishing Exonerating Evidence.
Since this is a Death Trope, expect unmarked spoilers ahead.
- Many times, the murderers in Detective Conan will claim they killed their victims (generally of the Asshole kind) only to defend themselves. 99% of the time said claims won't be validated by Conan and the other detectives; a police inspector even delivers one of these killers a "The Reason You Suck" Speech where he basically recited the whole Japanese law about self-defense from memory to disprove his claims.
- In Nausicaä of the Valley of the Wind, Kurotawa gets rid of his would-be murderer by sidestepping as he tries to push him into a Bottomless Pit, making a snarky comment on how the rumors of newly-sent officers (like himself) meeting unfortunate ends weren't exaggerated.
- Before the start of 100 Feet, Marnie killed her husband with the knife he attacked her with. She's just returned from serving two years of jail for the crime.
- Batman v Superman: Dawn of Justice: Unlike most incarnations, Batman has no qualms against using lethal force; among other things, he's crashed and wrecked vehicles with enemies still inside using the Batmobile, as well as using both its guns and the Batwing's to cause explosions near enemies, usually by blowing up nearby vehicles. He also allows his opponents to be caught in explosions, as by knocking grenades near them, or shooting Knyazev's flamethrower to save Martha Kent. However, he only uses lethal force against criminals, in response to them using it against him first; Zack Snyder even likens Batman's policy in this regard to the difference between manslaughter and murder.
- Played with, in that it was to protect someone else from being killed. In Saw, Adam is forced to bash Zep's head in with a toilet tank lid to protect Lawrence from being shot to death by him.
- Happens in Blood Simple., when the heroine manages to fight off and kill the Psycho for Hire.
- In Dial M for Murder, Margot Wendice's husband, Tony hires a crook named Swann to strangle her to death. However, Margot manages to stab him to death with her scissors. A Perfect Murder, the 1998 remake, has a similar situation, though in this case the wife stabbed her assailant to death with a meat thermometer rather than a pair of scissors.
- In The Guilty, this is Asger's cover story for having killed a young man in the line of duty. It was actually a Vigilante Execution.
- Discussed in Lucky Number Slevin, when the titular character asks the Rabbi how he reconciles being a devout Jew with killing people. The Rabbi replies that one is permitted to shoot a man in self-defense, which is how he justifies it (to himself).
- Non-Stop: When Marks confronts a fellow air marshal he thinks is behind the plot to hijack the flight, the two get into a fight in the plane's lavatory. The other one gets hold of a gun and Marks snaps his neck before he has a chance to use it.
- Our Man Flint. While Flint is in a restaurant bathroom, Hans Gruber enters and tries to murder him with a gun and a knife. Flint turns the tables on him and stabs him to death with his own knife.
- Pulp Fiction: Vincent Vega is assigned to kill Butch, but happens to take a bathroom break when Butch comes home. Butch finds Vincent's gun lying on the kitchen counter and shoots him.
- Jude has to do this twice in The Folk of the Air. The first time Valerian breaks into her room to kill her, and she has to quietly dispose of the body after. The second time she is challenged to a duel by Balekin, who intends to kill her as revenge for her thwarting a more subtle scheme. Cardan automatically assumes the first to have been an act of cold blood, but readily accepts that it was self-defense when the situation is explained to him. Given that Jude floated murdering her second victim several times before she's forced to actually do it, Cardan is less willing to listen the second time around.
- Goldfinger opens with James Bond with a glass of whiskey in hand, who is thinking about the Mexican killer whom he was forced to kill in self-defence, and tries to rationalize about it by telling himself that he was very likely a very bad person.
- Journey to Chaos: At one point in the first book, A Mage's Power, Eric has to fight an orc. In this verse, even the weakest orc is bigger, tougher and stronger than the average human and Eric is a teenager with beginner magic. The only way to protect himself and Annala, who was Tahart's initial target was to put the orc down for good. The in-house advocate for Eric's guild says the self-defense case is so clear that he won't have to stand trial for it.
- In Last Sacrifice, Eddie Castile kills James, a Moroi assassin who was trying to kill him with a knife, after the Moroi man attacks Lissa.
- Warrior Cats has a rule in the warrior code stating that Clan cats must not kill other cats to achieve victory, but they can kill either when outside the Clans or as a last resort.
- In American Horror Story: Asylum Lana Winters kills her son, who has been on a killing spree and has avowed vengeance on his mother for killing his father, the original bloody face (because he was also trying to kill her).
- Babylon 5: The episode "The Quality of Mercy" has a Back-Alley Doctor who uses an alien device to transfer her life energy to her patients. At the end, an escaped killer takes her and her daughter hostage, demanding he heal a wound he got from security, but she eventually realizes he intends to kill them both anyway and reverses the flow, killing him and curing herself (apparently the actual purpose of the device: executing criminals in a painless way while using the execution to save someone terminally ill). The courts decide that she acted in self-defense and drop any charges, on condition she turn the device over to station personnel.
- Boardwalk Empire has a few examples of this:
- Jimmy Darmody murders two thugs who were trying to mug him, an act which actually ends up having consequences for fellow mobsters Meyer Lanski and Lucky Luciano.
- Manny Horvitz murders a hitman sent at him by way of a meat cleaver to the head.
- Bones: a suspect in the Victim of the Week's murder (who was cleared when they found who did it) becomes a Stalker with a Crush on Booth, and decides to kill Brennan in order for Booth & her to be together. Booth jumps in front of the bullet, taking it in the shoulder; when the stalker woman raises her gun for another shot Brennan picks up Booth's gun and shoots her in the heart.
- An episode of Bull deals with a Gold Digger, who has apparently shot her husband after he stabbed her several times. Except the opener clearly shows her stabbing herself before pulling out the gun and shooting him, after he refuses to renegotiate her prenup (she wanted all of his billions, instead of settling for mere millions). It takes Bull a single conversation to figure out the truth. The damning evidence turns out to be her knowledge of anatomy (meaning she knew how to stab herself in a way that looks bad but is survivable) and latex gloves in her shredder with her own blood on them. She could've easily gotten away with it, had she not been so greedy, as the company execs were willing to buy her shares out for $500 million.
- Twice in CSI: NY with Stella, then Jo. Stella had to kill her angry ex-boyfriend and Jo wax attacked by the rapist whose case got her fired in DC.
- The opening scene of Justified shows US Marshall Raylan Givens kill a Miami gun thug in a restaurant. The criminal drew his gun first so the killing is deemed to be justified self defense. However, word spreads around that Raylan has previously give the gun thug 24 hours to leave town "or else". This causes doubts about the shooting and Raylan's superiors ship him off to Kentucky. Even Raylan admits that he is not sure if he would still have killed the criminal if the guy did not draw his gun first. Throughout the series Raylan kills more people but it is always in self defense.
- In the Law & Order episode "Hubris", this is how the Smug Snake villain meets his end. After representing himself and seducing a member of the jury to get himself acquitted, he tries to strangle her from behind while she's washing the dishes (his usual MO for dealing with witnesses) - she accidentally stabs him with a knife she was washing.
- In the season 2 finale of Person of Interest the Dirty Cop organization HR tries to set up Detective Joss Carter, one of the heroes, to get killed during a bust. Carter is quicker on the trigger than her would-be assassin, so the HR member on scene improvises, pocketing the assassin's piece to make it look to Internal Affairs like Carter shot and killed an unarmed man.
- The Walking Dead, Shane murders a hostage named Randyl in order to lure Rick into the forest to kill him and claim Lori and Carl as his own family. But Rick manages to kill him in self-defense just in time for Carl to shoot Walker!Shane in the head.
- Dice Funk: This is how the party rationalizes "the Stoneroot Massacre," in which Rinaldo escalated a fistfight into a bloodbath.
- Dawn of a New Age: Oldport Blues:
- After he gains superpowers that turn him into a bug monster, Benjy tries to hide in a warehouse that turns out to be occupied by a local gang of Neo-Nazis. They attempt to kill him, which in turn causes him to go berserk and kill them all in self-defense.
- Daigo uses his new power to mutate a Disposable Vagrant into a lizard monster. It attempts to eat Ciro's siblings, and then Ciro himself, and is only stopped when Zia steps in and explodes its brain with her telepathy powers.
- Some cases in Ace Attorney feature this:
- The first time it occurs in the franchise is in "Turnabout Samurai" ie. 1-3, where it's ultimately revealed that the killing was an act of self-defense. The surviving party does not come off as particularly sympathetic though, since it's revealed that the would-be killer's motive was taking revenge for having been blackmailed into submission for years on end.
- It's invoked in "Reunion, And Turnabout" (ie. 2-2), where the prosecutor tries to push Phoenix into pleading "justified self-defense". Though it's ultimately a moot point seeing as the killing was committed by a different person altogether.
- This was also The Reveal in the second case of Apollo Justice: Ace Attorney. The (relatively) spoiler-free recap being that the victim, Pal Meraktis, strangled the culprit, after which he tried to dump the body into a river. Said culprit was Not Quite Dead, however, and killed him shortly after regaining conciousness.
- It's also invoked in the final case of Ace Attorney Investigations: Miles Edgeworth, where the culprit claims he killed an interloper who was hired to steal something from him in self-defense. It's heavily implied to be a lie and it ultimately becomes a moot point seeing as he killed another person that night in what was not a case of self defense. The sequels final culprit makes a similar argument, about killing the fake president, since Simon otherwise made it a point to never kill anyone directly.
- It comes back in Phoenix Wright: Ace Attorney Spirit of Justice in the game's third case. Puhray was accidentally killed by Behlieb in self-defense. However, the crime was manipulated by Tahrust to make him look like an innocent victim of a random killing. This was done because Tahrust believed that Behlieb would've been convicted of murder instead of justified self-defense, both because of Khurain's highly corrupt legal system and also because Puhray was secretly a government operative. When he hears the truth, Phoenix even comments that it would've been a better idea to have him defend the killer so he could secure an acquittal on the grounds of justified self-defense.
- It's also discussed in the DLC case in Spirit of Justice, where the defendant allegedly killed a man whom had been attacking her. The case looks like justified self-defense, however the victim's autopsy showed he was struck twice: the first blow knocked him unconscious, the second blow killed him. Edgeworth, the prosecution, rightfully points out that since the defendant struck the victim after she had already knocked him out, she wilfully went beyond "self-defense" and into a straight out killing, and was therefore criminally responsible for his death. Phoenix never manages to counter this argument. The case instead shifts gears and eventually forgets about the "justified self-defense" angle entirely, even after the entire "she struck him twice" thing becomes irrelevant.
- Danganronpa: Trigger Happy Havoc has this for the first murder, where one of the characters attempts to commit a perfect murder on another character in order to escape the school. The attempted victim retaliates, however, and ends up stabbing them to death. However, it's pointed out that they had to leave the room and get the tools they needed to break into where the victim had taken shelter. Monokuma has none of this argument, though, and executes the surviving party anyway. The manga portrays it as both this trope and an Accidental Murder, the surviving party had been trying to snap their victim (who was still trying to kill them) out of a Freak Out!.
- Come to Chapter Four of New Danganronpa V3 where Miu created a virtual reality where she intends to kill Kokichi and frame Kaito. Unfortunately for her, Kokichi caught on what she was doing and manipulated Gonta's avatar into killing her.
- In Mica: Apoptosis, Mika responds to Tamora hitting her by brutally ripping her apart in anger. While she tries to justify it to herself later, it is clear that the force she used was way more than excessive, and she was essentially a murderer.
- Invoked and parodied by Hydraulic Press Channel via the "extra content" segments. Lauri's wife Anni sculpts cutesy little creatures out of clay, for the sole purpose of placing them on her husband Lauri's hydraulic press platform. Lauri always "rationalizes" the destruction of these cute figures this way by arguing that all of them "can a-ttack at ANY time, so we must deal with it." Cue the piston coming down and comically squashing the clay sculpture. The more harmless the creature would actually be if it were real, the better.
- In RWBY, at the penultimate finale of Volume 6, Blake and Yang kill Adam by impaling him through with the fractured shards of Gambol Shroud. Adam had previously vowed to destroy everyone and everything Blake loved as retaliation for "ruining his life", inflicted grave wounds on both her and Yang, and had stalked Blake across a continent to interfere with her: it's very clear he would never have stopped hunting the girls as long as he was alive, so their killing him is not presented in any unheroic way.
- Samurai Jack: In season 5, Jack is at first horrified that one of the Daughter of Aku he killed was human like he, not a machine as he had previously thought. But after recovering with the help of a wolf, he stands his ground and kills off almost all the Daughter of Aku when they strike again.
- Invoked and played with in early episodes of South Park: hunters Jimbo & Ned justify their hunting by shouting "It's coming right for us!" before shooting in order to claim self defense. This loophole is later closed (but they find another loophole to use).
- The story goes that Edward I killed a Mamluk assassin with his own blade.
- A man in Portland, Oregon hired a hitman to kill his estranged wife. After a protracted struggle, the woman was able to disarm the hit man and subsequently strangled him to death.
- This is not uncommon in the United States; every state in the Union has some form of legal homicide in self-defense, with some states being more lenient than others. The most common is what's called "castle doctrine" or "castle law"; in castle-law states it is perfectly legal to kill someone in self-defense on your personal property without having to attempt to flee first if you reasonably believe a life is in danger or to prevent the commission of a violent crime. In a majority of states, the killer even enjoys a degree of legal protection against civil damages related to the killing. It varies from state to state, and sometimes from county to county.
- The other most-common legal stances on killing in self-defense are "duty to retreat", in which you may only kill in self-defense if you have no possible means of escape (such as being cornered in a room), and "stand your ground", meaning you can kill in self-defense anywhere, not just in your home (but you still have to have a demonstrated reason to believe your life is in danger). Castle doctrine states could be considered "duty to retreat outside your property, stand your ground on your property."