Sherlock Holmes demonstrates this by going down with Moriarty, and successfully pulling this trope twice in one shot! Not only did he drag his arch-nemesis off the edge, but in a Moment of Awesome he also took his creator Sir Arthur Conan Doyle with him. Doyle's reputation was ruined for trying to kill the greatest literary character of all time, so much so that he was forced to bring Holmes back to life in order to save it.
In the first short story featuring Johannes Cabal the Necromancer, "Johannes Cabal and the Blustery Day" Johannes has to deal with a murder-by-proxy attempt when the fairies that live in his house beneath the floorboards (the Skirtingboard people) attempt to kill him by summoning a dread force called The Bone Wind-but he has time to prepare as the wind won't arrive till mid-day. He gathers defenses for his house and a number of weapons but also, in case that will fail tinkers with his houses boiler so that it will build up and explode if he does die.
In one of Aesop's Fables, a wasp lands on a snake's head and amuses itself by tormenting and stinging the poor snake. The snake eventually can't take it any more, so it crawls over to the side of a road and places its head underneath the wheels of a travelling cart, killing both itself and the wasp.
Averted. Hazel and Frank are afraid Percy’s done this to get rid of the Roman shades in Alcyoneus’s lair, but the readers know he’s fine because his water gifts will protect him from the fall.
Played straight during Hazel's first life, when she discovers she was being manipulated by Gaia into reviving Alcyoneus, the giant. She uses her powers as a daughter of Pluto to bring down the cave where the giant was forming, killing herself, her mother and effectively delaying the giant's revival for several decades.
And in the last book, on Jake's orders, and possibly in the last sentence.
Which is an Ironic Echo to The Andalite Chronicles where Elfangor pulls the same stunt on Visser Three (although both survive).
David attempts this in The Solution, attempting to trap Rachel in the cage with him. Naturally, the attempt fails.
In Dale Brown's Fatal Terrain Brad Elliot crashes the crippled Megafortress into a Chinese ICBM site.
In Storming Heaven a pilot crashes his F-16 into a 747 that was heading for Washington DC and aiming itself at the White House.
Wizards of Jim Butcher's Dresden Files universe have this as one of their powers. Their death curse, cast using their life's energy in their final moments, is a significant threat that keeps most supernaturals from taking them on directly. The most worried option is the one cursed will be killed and the curse can be spread among a large number of people, say a small army. There are other options, such as one female wizard used her death curse to make a powerful vampire unable to feed. It's not unavoidable, as sufficient preparation, such as a sniper rifle, can kill a wizard before they know what's happening and, thus, can not bring out the curse. Someone of significant power can also repel a death curse. And if the wizard died in a moment of confusion, they wouldn't have time to focus.
In the Eoin Colfer novel The Supernaturalist, a hero, Stefan Bashkir, after being mortally wounded at the end of the book, attempts to drag villain Ellen Faustino to a fiery death in a literal dead man's grip. Subverted in that Bashkir dies and Faustino survives (albeit horribly disfigured) to continue her evil plan.
In Frank Herbert's Dune, Doctor Yueh gives Leto a fake tooth filled with Deadly Gas with which to try to assassinate Baron Harkonnen. Leto breaks the tooth and exhales, but the Baron is able to move away just in time thanks to his personal shield, leaving Piter de Vries to take a big whiff and drop dead.
In the prequels, a Harkonnen does this to eliminate an extremely influential politician who was also Drunk with Power.
The witches of Rossak employ this tactic, by using their immense psychic powers to fry all organic brains within a large radius, cyborg and human alike.
In the Redwall series, the Badger Lords of Salamandastron frequently invoke this trope. The Badger Lords usually do die along with whatever villain they are trying to kill.
Typically they use this as their Moment of Awesome. One Badger Lord essentially pile-drives a foe off a mountain. While already dying.
The Reynard Cycle: As soon as Reynard's trap is sprung in The Baron of Maleperduys, dooming the combined Calvarian army, the Calvarian general Drauglir immediately makes a bee-line for Reynard, hoping to kill him so that all of his soldiers deaths will not have been in vain. It doesn't work out for him.
In Robert Jordan's The Wheel of Time, there is a technique wherein you allow your defenses open so your opponent stabs their weapon into your body. Thus hindered, you then counterattack, killing them but likely dying in the process. The protagonist using it doesn't die.
Neither does the antagonist at that time. When the Big Bad can move dead souls into new bodies that doesn't mean much, but the protagonist fights the antagonist who inhabits the same body later in the series. Neither of them die in the first duel, but both are grievously wounded.
Another character does this same thing in the final book to a different villain. The hero is a master swordsman, but the villain is slightly better. When the villain tells him that he can't win, he replies "I didn't come here to win. I came here to kill you" - and deliberately allows himself to be stabbed, intending to perform a Mutual Kill. The villain dies, but the hero is rescued and magically healed.
Mages can do this in Mercedes Lackey's Heralds of Valdemar novels, overloading themselves past survivable limits to deliver a final blow to their enemy or their surroundings in a technique known as a Final Strike. Herald-Mage Vanyel finishes the Last Herald-Mage trilogy in this way, combining his own stored-away energy and his Companion Yfandes's to take out an enemy mage, immolate his army, and glass the entire valley they were attacking through.
In Brightly Burning Lavan does something similar after his Companion is killed, destroying the entire invading army, and shattering stone with the heat of his fire. Since she was the control mechanism for his power, it's expected.
Space Marine Battles has it happen way too often for Space Marines' health. To recount just a few examples...
Purging of Kallidus: Namaan goes down with an Ork Walker.
Legion of the Dead: Omar takes a pack of flying daemons with him.
Fall of Damnos: Agripped stands his ground against a Zerg Rush of Necrons.
Siege of Castellax: Vortsk to yet another Zerg Rush, this time Orkish.
Death of Antagonis: Nessus tries to do this to Volos. In a surprising twist, it doesn't work.
Death of Integrity: Voldo attempts this with genestealers. In a surprising twist, he survives.
Used in the final battle against the Cannibal Welfare Mutants in Larry Niven and Jerry Pournelle's Lucifer's Hammer. "At the Academy, they taught us there was one sure way not to miss..."
Garth Nix's Sabriel. The bell Astarael sends all who hear it deep into Death. Very much a last resort for the necromancer or Abhorsen who uses it, such as Sabriel's father, cornered by Kerrigor and hordes of Dead in the palace reservoir. Sabriel and Touchstone narrowly escape. In this series, though, dying isn't necessarily more than a minor obstacle.
In Nick Perumov's Ordered Universe, a wizard's sacrifice gives him enormous powers at this moment, allowing to take down enemies far stronger than he is.
Patriarch Heon's helper, Lancet (Ланцетник) in Nick Perumov's Keeper of the Swords series used an egg-shaped artifact to utterly burn everything in the underground catacombs, most of the remaining parts of the city above and even demolish three Magi towers when their underground command center was overrun by poisonous vermin summoned by the Magi.
In Snow Crash, the Badass Biker has a hydrogen bomb on his motorcycle, rigged to explode if he dies. It doesn't go off during the book.
Towards the end of The Builders, Bonsoir gets gut shot by Puss and starts to bleed out. He decides to light a stick of dynamite when Puss isn't looking, and both of them are killed in the ensuing explosion.
Apparently this is the only way to kill a Balrog. In The Silmarillion, two Balrogs die at the siege of Gondolin, but so do their opponents: Ecthelion dies of his wounds, and Glorfindel kills a Balrog by knocking them both off a cliff.note Glorfindel, at least, gets better, and appears later during The Lord of the Rings.
"The Children of Hurin" contains a villainous example, in Glaurung, The Dragon figuratively and literally. After Turin stabs him Glaurung restores the memory of Turin's pregnant wife, who realizes she is Nienor, Turin's sister. She kills herself and shortly after, Turin finds out and throws himself on his sword.
1633 has two such moments, sort of, in a single battle. First, Eddie Cantrell (accidentally) rams his crippled speedboat into a Danish warship, followed by Hans Richter, wounded and knowing he can't make it to a safe landing, flying his plane into another warship. Hans is immortalized as a war hero. Eddie, surviving by sheer luck, is captured by the Danes, but he eventually hooks up with the Danish king's daughter and gets made an Imperial count, so he wins.
In Legend of Galactic Heroes, Adrian Rubisnky, the former leader of the formerly independent planet Phezzan, dying of a brain tumor, had had a brain wave monitor implanted to his brain that would cause a shitload of explosives to detonate in the event of his death. As the city in question to be blown up was the capital of the former Alliance, the interference of the cultist faction bent on destroying both the Alliance and the Empire is a given.
In a metaphorical sense, oil tycoon Ellis Wyatt from Atlas Shrugged, when he sets his oil fields ablaze in response to laws aimed at draining him dry. He even says the trope name in almost so many words beforehand, as foreshadowing.
In Wizard's First Rule, there's a spell mentioned called "Wizard's Life Fire." A wizard who knows this spell can sacrifice his life and go out in one big fireball.
In Stephen R. Donaldson's Gap Cycle, Ciro implodes a singularity grenade to destroy the Amnion warship.
In the short story "Above It All", some kind of creepy presence possesses the Mir space station and makes a cosmonaut kill himself. An American astronaut gets sent up to recover the cosmonaut's body and the presence gives him a mental Breaking Speech and prevents him from reaching the escape capsule. He fires the station's control jets, sending himself, the presence, and the station falling into the atmosphere, where they all burn up.
In Mistborn, this is how Vin kills Ruin. In fact, this is implied to have been the only way Ruin could have died, as Vin had recently become a god and Ruin's opposite. Because their powers were equal, only complete self-sacrifice on Vin's part would be able to destroy her opponent's consciousness. As such, both characters die.
In Dark Rendezvous, Count Dooku plans one of these by aiming a missile at his mansion, in case negotiations with Yoda break down and the Jedi Master is able to defeat him. Naturally, Yoda stops the missile from hitting, by pushing it off course—but Dooku uses the opportunity to make his getaway.
Likewise, in The Cestus Deception, ARC Captain Nate, having discovered his own sense of individuality and a life and family outside of being a soldier in the Grand Army of the Republic, commits both TYWM and Heroic Sacrifice by ordering an orbital bombardment down on his own coordinates to ensure Cestus's corrupt leaders don't escape the planet. His romantic interest is revealed to be pregnant with his child in the epilogue.
Many Sith and Dark Jedi in Legends have a power that lets them violently explode upon being mortally wounded, like the Emperor does in Return of the Jedi. It's strong enough to be very dangerous at close range—unfortunately for the Dark Jedi and Sith, in all of the books where this happens the people who kill them are also canny enough to get out of the way.
In The Coming of the White Worm by Clark Ashton Smith Evagh's slaying of Rlim Shaikorth also means his own death, but he was doomed anyway.
In a partial example, the main character's releasing the narcotic gas in Vulthoom also by Clark Ashton Smith means that he and his friend are going to die from dehydration in their drugged sleep, but the bad guys are only going to sleep a thousand years.
In Les Misérables, Marius threatens the enemy with this when he arrives on the barricade. He has a powder keg. The National Guard leave very quickly. Unfortunately, they return later...
In the Tom Clancy novel Red Storm Rising, the readers (and a Soviet general) are shown the end result of a NATO fighter that crashed into the anti-aircraft mount that shot it down.
The Night Watch series features an uber-spell called "The sarcophagus of times". When used it's supposed to seal both the caster and the victim inside the said sarcophagus till the end of the Universe.
In Physik, Queen Etheldredda unsucessfully tries to do this with Jenna.
In Darke, Tertius Fume takes Alther's ghost with him as Marcia banishes him to the Darke Halls.
In Guy Gavriel Kay's The Fionavar Tapestry, Diarmuid duels the captain of the evil army, Uathach, but is unable to hurt the monster because Uathach gigantic sword keeps him too far away. He only manages to kill Uathach by letting the gigantic sword stab him full through the left half of his torso, at which point he stabs the evil captain in the face.
The first is Kalarus rigging the volcano that his city resides on to blow if he dies, by sealing the great fury inhabiting the volcano to him. This will kill not only his city, but any of Alera's Legions in the region. Gaius Sextus proceeds to prematurely detonate the volcano, destroying the city before his Legions could arrive.
Gaius Sextus gets his own moment when the Vord are assaulting Alera Imperia, and he destroys himself about 90% of their army by detonating another volcano on them.
High Lord Cereus diving into a vordbulk's mouth and blowing it up from the inside to prevent it smashing the wall behind which his granddaughter is hiding. As Ehren puts it, "It was one thing for a man to say he was willing to lay down his life for his child-but quite another for him to actually do it."
In James H. Schmitz's novel The Demon Breed, invading aliens have captured Ticos Cay, a research biologist. Knowing that they'll execute him sooner or later, he manages to stock his prison/laboratory with a large number of innocuous-looking biological specimens — which, given the correct stimulus, aren't innocuous at all.
In The Curse of Chalion this is how a Death Miracle works: one prays to the Bastard, who sends a demon for the soul of the target. However, the demon must take two souls before it can return, so it takes the soul of the person who asked for the miracle as well.
The death of a Tat' Divine Lord triggers an explosion on the geologic scale - the last known location where a Tat' Lord was killed on land became the Grand Canyon.
Marina remains in the melee during the battle in Galla's temple with a primed grenade in her hands. She sends Sant'yaga away and simply points to the body of her fallen lover and protector Sergey.
In Vadim Panov's Enclaves:
A high-standing member of the "42" movement, suffering from a Deadly Upgrade, pulls this on the movement's leader, claiming that he betrayed their goals.
Kirill calmly finishes sculpting a new altar from a holy stone and sends his helpers away with the altar, then simply waits for a rival practitioner to arrive. He then proceeds to explain the situation as the now defunct temple drops from reality.
In The Hunger Games, Cato invokes this with Peeta in a headlock to get Katniss not to shoot him and send them both down to the awaiting wolf-mutts. But thanks to an arrow to the hand, it doesn't work, and only he goes down.
In the Secret Histories novel Casino Infernale, the plot revolves around the search for the mysterious Crow Lee inheritance. Eddie Drood finally finds it, only to discover that it is an artificial black hole set to activate when a member of the Drood family touches it. Fortunately for Eddie, Sufficiently Advanced Aliens have given him a Deus ex Machina.
Gesta Danorum: Holding out his neck for Hather to decapitate him, Starkad advises Hather that jumping between his severed head and the trunk before they can fall to the ground will protect him against being wounded in battle. Hather strikes Starkad's head off, but realizes at the last moment that Starkad intends to crush him with the weight of his falling body.
A Song of Ice and Fire: Before he duels Gregor Clegane, the man who raped and murdered his sister and her children, Oberyn Martell tips his spear with slow-acting poison so even if he should die, Clegane will die as well. However, it doesn't quite go as planned. Though Clegane spends days in agony he has possibly been resurrected through necromancy.
The Mad King Aerys II had wildfire placed around King's Landing. When Tywin Lannister attacked the city, Aerys decided to set alight the wildfire, killing Tywin, his troops, and the 500,000 people of King's Landing. However, Tywin's son Jaime Lannister became The Oathbreaker and slew Aerys. Jaime wonders if Aerys might have believed he would turn into a dragon from the wildfire and take vengeance on his enemies.
In Inheritance, the final book of The Inheritance Cycle, Eragon's move that finally unhinges Galbatorix is to cast a spell, along with the power of the dragons, that causes him to feel every feeling that he's evoked in others throughout his life, both good and bad. The agony of it is so terrible that Galbatorix eventually decides he just can't take it anymore and declares "Be not!" in the Ancient Language, annihilating himself and producing a nuclear blast of energy that very nearly destroys Eragon and everyone else with him and would have likely destroyed a large portion of Uru'baen as well had they not been so far underground and had Eragon not cast the appropriate protective spell.
In the Christ Clone Trilogy, Christopher Goodman as the Clone Jesus and the Antichrist knows that he's destined for Hell, so he intends to take as many people with him to hell at Jesus' Second Coming as he can, all to make God weep. He's also hoping to see Decker Hawthorne, the one who raised him and helped him become the United Nations Secretary-General, there as well, but unfortunately for him Jesus saved Decker from that fate.
In The Sword-Edged Blonde, when Canino gets shot and Gretchen pulls the arrow out to ensure that he bleeds to death, Canino is left with enough time to stab her before he goes. She doesn't seem to care.
The main characters in Eden Green are infected with an immortal symbiote. One of their number makes it her mission to overcome its healing factor, in order to kill herself and all other infected.
In The Moon Men by Edgar Rice Burroughs, the hero Julian confronts the villain Orthis in the midst of an alien invasion Orthis has orchestrated. When Julian demonstrates that he's figured out how to nullify Orthis' greatest weapon and calls on him to surrender or be destroyed, Orthis declares, "Never! This is the end... for both of us", and activates a self-destruct mechanism that kills them both.
At the end of Paths Of Darkness Le'Lorinel breaks out a potion that mirrors all wounds he recieves on Drizzt in an attempt to kill them both, because he cannot best him in battle. It almost works, too, only the arrival of Drizzt's friends keeps both of them from bleeding out. Like this only Le'lorinel dies, because the companions use their healing potion on Drizzt.
In The Ghost Brigades, Jared takes the opportunity to, effectively, shoot both himself and his target with Chekhov's Gun. When Boutin pulls a Grand Theft Me, he discovers that Jared's last recorded message to him included a code that made the nanites that made up Jared's blood superheat and self-destruct, a move he had used to make knifing him unhelpful earlier in the novel.
In the climax of the fifth Warrior Cats book, Bluestar charges the leader of the dog pack and knocks him into the gorge; she lands on the edge but as the dog falls he manages to bite one of her legs and drag her in after him. She survives only long enough to have a final conversation and reconcile herself with her kits.
In Victoria, the high-tech Amazons of Azania are very proud of their all-female utopia, and hate and fear all men, who would abuse and enslave them. When their republic is about to fall to their Christian fundamentalist enemies, they are so desperate and terrified that they opt for Götterdämmerung and arm a thousand-megaton nuclear bomb under their capital, to save themselves from a fate worse than death and take the enemy army with them, too. Darkly subverted, in that the enemies cajole the operator into surrendering, and the bomb never goes off. The Azanians are then made wives, and/or slaves, of the conquerors.