[[quoteright:300:[[VisualNovel/ShuumatsuShoujoGensouAlicematic http://static.tvtropes.org/pmwiki/pub/images/rsz_25_3622.jpg]]]]
[[caption-width-right:300:Kinda like this, but less physical... normally]]

->''"Those who live by the sword get shot by [[CombatPragmatist those who don't]]."''
-->-- '''Anonymous'''

The timeless Internet argument. On many forums, the debate over whether guns or swords are better rages on. Common (but not necessarily true) statements from either side include:

* Guns have longer range!
* Guns are easier to use!
* Guns are more common!
* [[CombatPragmatist Honor doesn't matter in a real fight!]]
* [[BoringButPractical Guns]] [[RuleOfCool are just cooler!]]
* [[RevolversAreJustBetter Revolvers]] and [[ShotgunsAreJustBetter shotguns]] are badass!
* Pulling the trigger is quicker and easier than swinging a sword!
* Guns are still the weapon of choice for nearly all military and law enforcement agencies around the world.

* Swords don't jam, misfire or need reloading!
* Swords do more damage to people!
* [[ElegantWeaponForAMoreCivilizedAge Swords are more honorable!]]
* [[KatanasAreJustBetter Katanas]] [[ParryingBullets can deflect and cut (certain) bullets in half!]]
* [[AwesomeButImpractical Swords]] [[RuleOfCool are just cooler!]]
* Sword fights are more intense!
* Sword slashes covers more range and are more practical in close quarters!
* Depending where you live, legally obtaining a firearm may be impossible. Most countries today do not restrict swordsmanship or fencing (although openly carrying around a big sword might still get you on trouble).

It's obvious that neither side will give in any time soon. So here are some examples of this playing out in fiction, and notable RealLife examples. Please remember that this is NOT about which is better!

Related to KatanasAreJustBetter, ShotgunsAreJustBetter and RevolversAreJustBetter. See SwordAndGun and TheMusketeer for when someone decides to pack [[TakeAThirdOption both]]. See MixAndMatchWeapon for when swords and guns, along with other weapons, are fused together into a weapon [[AwesomeYetImpractical that will be cooler than both but may or may not work]]. If this trope is used, it may also be used alongside a MagicVersusScience argument, though not always. It can also be justified with a RetroUpgrade for melee weapons. Authors sometimes use FantasyGunControl to enforce [[AuthorAppeal their preference for swords]].

Also take note that [[JustForFun/GunCounterpart both sides have more in common than you might think]], at least thematically


[[folder:Anime and Manga]]
* In ''Anime/CowboyBebop'', Spike uses a gun, and his rival, Vicious, uses a katana. They're shown to be equal fighters, at least partially because Vicious recognizes the limits of his weapon and uses stealth to get up close.
** Having said that, both times they fight, Spike has already taken at least one gunshot wound. But since it's a HeroicBloodshed show, it can be questioned whether they [[JustAFleshWound slow him down]].
* Similar to the above example, ''Manga/BlackCat'' has the protagonist using a gun while his archenemy uses a sword. They are pretty evenly matched regardless. Sephira, however, is actually the best swordsman in the series.
* ''Anime/GunXSword'' fits in with the above examples. Van uses a sword, Ray uses a gun.
* Episode 12 of ''Manga/BlackLagoon'' had a scene where Revy and KnifeNut mercenary Shenhua argued about whether guns or knives were better, and then decided to demonstrate their points by slaughtering a small army pursuing them.
** Also, Revy vs. Ginji, who does in fact wield a katana and can [[ParryingBullets cut bullets in half with it]]. After much bullet-slicing and GunKata, [[spoiler:Revy wins.]]
* In the [[SoBadItsGood really terrible]] anime ''Anime/MusashiGundoh'', everyone dual-wields a gun and a sword, except for the main character, who just uses guns.
* The protagonist in practically every continuity of ''Franchise/{{Zoids}}'' ends up using a blade-wielding mecha against plenty of guns.
* In ''Anime/MobileSuitGundam00'' Season 2, in his last battle [[WarForFunAndProfit Ali Al-Saachez]] claims that close range combat is the best. He's then defeated by [[FriendlySniper Lockon Stratos]] and his Gundam's beam pistols.
* The ultimate confrontation of ''Anime/AfroSamurai'' involves this. Afro, as per the title, uses a sword, while his nemesis, Justice, uses guns.
* ''Manga/{{Bleach}}'' has DualWielding for both Captain Shunsui Kyoraku (Swordsman) and his opponent, Espada Coyote Starrk (Gunslinger). On top of that, both are CombatPragmatist that pull every dirty trick in the book to win. [[spoiler: Kyoraku wins.]] It's apparently a running gag for Kyoraku, who later ends up facing two more gun wielders during the Vandenreich invasion. [[spoiler: Kyoraku loses against the first one, then requires Nanao's help against the second.]]
* The extra "After Days" chapter of the ''Anime/MagicalGirlLyricalNanohaStrikerS'' manga featured Nanoha vs Signum in an exhibition match, complete with combat commentary that contrasted the fighting techniques of the two combatants. Nanoha is TheAce with her BeamSpam-dispensing BoomStick. Signum is a MasterSwordsman from Ancient Belka. Who will win? [[spoiler:[[EvasiveFightThreadEpisode It ends in a tie]]]].
* In ''Anime/DigimonFrontier'', [=EmperorGreymon=] and [=MagnaGarurumon=] are all over this. The first does battle with a {{BFS}} and dragons made of fire, while the second is carrying maybe a half-ton of weaponry in lasers, bullets, and rocket launchers.
* ''Manga/JoJosBizarreAdventure'' has [[PluckyComicRelief Jean-Pierre Polnareff]] (sword) and [[IneffectualSympatheticVillain Hol Horse]] (gun) holding a silly, shonen-esque debate on whose weapon is better. [[spoiler: Judging from the final outcome, Polnareff wins. He successfully kills Hol Horse's accomplice, while Hol Horse not only runs away, but his apparent headshot on Avdol also [[WhatAnIdiot misses at the last second.]]]]
* In ''Manga/FairyTail'', Erza (swordswoman) and Bisca (gunslinger) use the same kind of magic and the latter admires the former.
* ''LightNovel/SwordArtOnline'' presents this quite literally in its third arc, where Kirito enters the world of Gun Gale Online. Despite having poor accuracy and fighting many opponents with guns, Kirito is able to defeat them all by equipping a photon sword and using his reflexes to deflect bullets, something no other user has ever even attempted.
* We get this late into ''Manga/AttackOnTitan'' once [[spoiler:the Military Police's Central 1st Brigade gets introduced and they clash with the Survey Corps.]]
* In ''Anime/BakumatsuKikansetsuIrohanihoheto'', Akizuki Yojiro uses a katana, Getsuruito(Moon Tear Sword), while Kanna Sakyonosuke uses a dual pistols, Remington Model 1858.

* In a team up event, Comicbook/{{Blade}} and Comicbook/ThePunisher meet on a rooftop. Punisher has a gun to Blade's head and Blade has his sword to Punisher's neck.
* Elsa Bloodstone in ''Comicbook/{{Nextwave}}'' was a combat specialist, and mostly stuck to using guns, but upon facing a bunch of samurai robots, she declares "[[RuleOfCool Samurai Robots beat guns. Every time]]." So she drops her guns, pulls out her own sword, and proceeds to face them that way.
** And by sword we mean Shovel.
* Miho wields her katanas against guns all the time in ''Comicbook/SinCity'' and wins.

* In a famous scene from ''Film/RaidersOfTheLostArk'', Indiana Jones is confronted by a formidable sword wielder. [[WhyDontYaJustShootHim So Indy just shoots him]].
** Allegedly [[ThrowItIn a hasty rewrite]]. An epic SwordFight was planned but Harrison Ford had a minor back injury when it was due to be filmed. [[RuleOfFunny Comedy]] and [[CombatPragmatist pragmatism]] took the day.
*** Another version has Ford suffering from diarrhea that day.
* ''Film/TheLastSamurai'' portrays this quite well.
* ''Film/{{Yojimbo}}'' pits a gangster with a revolver against a [[PlayingBothSides shitstirrer]] with a katana, both of whom say their respective weapons are best.
* ''StarWars''
** Swords. There's always Obi-Wan's line from about light sabers being an "elegant weapon" and going on to say that they're "Not so clumsy or random as a blaster". When circumstances lead to him using a blaster, he chastises himself for being "So uncivilized."
** Guns. There's Han Solo's declaration that "Hokey religions and ancient weapons are no match for a good blaster at your side, kid." In ''Film/TheEmpireStrikesBack'', Darth Vader proves him wrong. On Hoth in the same film, Han uses Luke's lightsaber briefly (the only non-jedi to do so in the film series) to cut open Luke's mount.
*** Two factors make guns preferred for most people. First is the power beind the "hokey religion" is actually real and observable. Second, only a select few can actually tap the power and it still takes training to use the power to effectively use the sword.
* Featured prominently in ''Film/SukiyakiWesternDjango'', all manner of weapon was used, culminating in a dual between the Hero and the Big Bad in the final scene, with the {{Hero}} using a pistol against the BigBad's Katana. He even parries a strike from the Katana, locking it against the finger guard. [[http://3.bp.blogspot.com/_sx1MlBYps0A/SavFyGdt3aI/AAAAAAAAAYk/iJ2PkqG4S3g/s320/sukiyaki-western-django-2.jpg As shown in this picture]]
* Don't forget the ending sequence for the ''Film/VForVendetta'' movie - the bad guys shoot up V with submachine guns. But, thanks to his superhuman strength (and metal chest plate) recovers enough strength to kill them all with his many knives before they can reload.
* Although it's not ''strictly'' guns versus swords, in ''Film/TheExpendables'' Barney Ross and Lee Christmas are in constant disagreement over which weapon is better: guns or knives. Barney favors guns, Lee favors knives.
* Ash clearly demonstrates the superiority of a double-barreled shotgun over a broadsword in ''Film/ArmyOfDarkness''.

* ''Literature/TheLordsOfCreation''. Lampshaded in the prologue of ''In the Courts of the Crimson Kings''. The first pictures from Mars show the inhabitants are armed with firearms and swords. Some speculate that it's due to a code of honor, but it's pointed out that it would give the cheaters too much of an advantage. It turns out Martians use biotechnology guns that are slow to reload, so they need to have a weapon handy in the interim.
* Exaggerated in [[Literature/{{Okuyyuki}} "Okuyyuki"]], which goes one better and makes it ''[[CoolVsAwesome T-72 tanks vs katana]]''. [[OneManArmy Reilly]] takes on four of them with only his sword. [[spoiler: He wins, but is mortally wounded in the process]].

[[folder:Live Action TV]]
* In ''Series/TheWalkingDead'', the question is posed as to which is more efficient after the zombie holocaust after Michonne joins the cast. Michonne's sword proves invaluable, as it can be used to kill endless waves of zombies without running out of ammo, though its obviously much less effective when fighting human enemies. One of the best things about her sword is that it enables the crew to safely kill zombie hoardes while saving their firearms ammo for more formidable threats like armed hostile humans.
* As ''Series/{{Mythbusters}}'' has pointed out, katanas cannot cut through gun barrels, because the barrels are quite strong indeed.
* [[Series/MockTheWeek "A lot of you will be wondering, why there are so many wonderful treasures on display here, at the British Museum. Now, it is quite simple, really: Gun beats spear!"]]
* The hero and villain of ''Series/TheFollowing'' exemplify this trope- gun toting FBI agent [[Creator/KevinBacon Ryan Hardy]] and KnifeNut SerialKiller Joe Carroll.
* ''Series/DeadliestWarrior'' has many warriors fight each other, though most have weapons from a similar era. This is the exception for Knight vs Pirate. Knight can be considered one of the most powerful ancient warriors due to its armor and metallurgy of weapons while Pirates are one of the oldest gunfighters and had no long ranged rifles or muskets in the match. While the Pirate did have a sword he obviously prefered gunpowder weapons as well. [[spoiler: While the Knight has more skill, better melee weapons, more money and armor these factors were pointless in the face of the Pirate's weapons. The Grenado exploited the small gaps within the Knight's armor and could still harm a Knight to some degree if it was stopped by the armor, but the Blunderbuss especially dominated the fight with its ability to pierce through the Knight's armor with ease and could aim accurately before the Knight could even get in close.]]

[[folder:Tabletop Games]]
* ''TabletopGame/{{Warhammer 40000}}'' is all about charging the enemy before he can gun you down, or shooting him before he can reach you.
** Though many units designed for close-combat use SwordAndGun as the rules make having a pistol and melee weapon the same as having [[DualWielding two melee weapons]] for lots of melee weapon types except you can shoot with the pistol, combining two great tastes in one.
* ''TabletopGame/NewHorizon'' has rules for melee and ranged combat. Melee usually does more damage, but ranged weapons can be used from atop fortress walls. Also, the melee weapons are better able to price though though hides and armor, so they tend to be more useful to fight the local wildlife and heavy infantry. Guns are good for softening up targets from a distance and taking care of squishy unarmored humans. Otherwise, the advantage of Melee weapons is that they do more damage by increasing strength and close combat, where with ranged combat only the chance to hit is increased.
* In the ''TabletopGame/NewWorldOfDarkness'', the advantages of each are highly situational, depending on the material of the weapon and the specific opponent out of the setting's FantasyKitchenSink. A shotgun loaded with ColdIron or {{silver|HasSupernaturalPowers}} can be devastating against a TabletopGame/{{Werewolf|TheForsaken}} or [[TabletopGame/ChangelingTheLost True Fae]], but would only annoy a TabletopGame/{{Vampire|TheRequiem}}; on the other hand, a trained spear fighter can tear a vampire a new one. Also, as an UrbanFantasy setting, there's the matter of acquiring, licensing, and transporting your weapons, since RealityEnsues if you carry a zweihander down a busy street...

[[folder:Video Games]]
* In ''VideoGame/SoulCalibur'', Mitsurugi's bio mentions that he lost a duel against a rifleman, and wants to find the Soul Edge because it's superior to any other weapon, including guns (he also spent a good part of his time devising techniques against firearms).
** Expanding on above example: Mitsurugi's ending in ''VideoGame/SoulBlade'' gives you a special, first-person-perspective fight against a soldier wielding an old, front-loaded rifle, dubbed 'Tanegashima' after the old Japanese word for firearms. If you don't do EXACTLY the right thing the moment the battle starts, you'll get shot, and get the 'bad ending' (which is also the canonical one, as stated above). However, if you step to the side the moment the battle starts, you can dodge the bullet, then quickly close the distance before the rifleman can reload, and cut him down - giving you a Good Ending where Mitsurugi declares that he has no need for the Soul Edge, since his own badass sword-skills are enough to take on even firearms.
** Mitsurugi eventually abandons his pursuit of Soul Edge when he becomes strong enough to defeat riflemen on his own.
* Played straight in ''VideoGame/{{Gunz}}''. Your character is equipped with guns and swords. Swords do more damage, can deflect bullets, and glitch up the game in advantageous ways. Guns are guns.
* In the later ''Franchise/FinalFantasy'' games, the two exist side by side, mostly due to {{Charles Atlas Superpower}}s as well as Magic being prominent. Some examples:
** ''VideoGame/FinalFantasyVII'': Barrett's weapons range from big metal balls to Gatling guns, all of which attach to his right arm. Vincent uses a rather large pistol, while Cloud uses a BFS. Regular soldiers are seen wielding assault rifles, and heaver mechanized weapons do exist.
** ''VideoGame/FinalFantasyVIII'': Irvine uses a rifle while Zell beats on things with his fists. Laguna uses an assault rifle and grenades, but his parter Kiros uses Katals. Squall's gunblade is just a sword that can detonate on impact for extra damage.
** ''VideoGame/FinalFantasyXII'' is where things get a little interesting. The airships are armed with heavy machine guns, but for ground combat, swords and armor is the preferred method of fighting. The man-portable guns that do exist are of the Blunderbuss variety.
** ''VideoGame/FinalFantasyXIII'' takes it one step further. Assault rifles are now the default weapons for armies, along with grenade launchers and the occasional baton. Lightning uses a weapon that converts between a gun and a sword, Snow punches things, and Sazh uses dual pistols that combine into a rifle.
* ''VideoGame/FableII'' allows the protagonist to use both guns and swords and faces enemies that use both. Both have advantages and disadvantages, but a character can theoretically use either exclusively.
* In ''VideoGame/{{Onimusha}} 2'', you can have a competition with the gunfighter to see which is better: Your katana or his rifle, seeing who can kill the most enemies in a fixed period of time. Of course, this is a katana against a 16th century matchlock. In real life, the gunman would have only been able to shoot a handful of times in the timeframe involved.
* In ''VideoGame/{{ResidentEvil4}}'', Leon and Ada [[CutscenePowerToTheMax have a flashy knife-to-gun fight]]. In the end, Leon gets the upper hand, disarms Ada and holds his knife to her throat. [[WorthyOpponent He lets up,]] [[UnresolvedSexualTension though.]]
* In ''VideoGame/ModernWarfare 2'' a ludicrously effective strategy is using Marathon (for unlimited sprinting), Lightweight (to move faster), and Commando (which lets you stab enemies from a longer distance away) - and use a pistol with a tactical knife attachment (to stab faster). Essentially, this lets you dash everywhere and stab everyone for a one-hit kill. Granted, if someone sees you coming, they can gun you down from a distance pretty easily, but ninja-ing your way through the maps is still quite effective.
** Marathon and Lightweight mean a player sprints all the time and so fast one can easily run straight at claymores--their explosion is delayed by a fraction of a second, enough for a runner to be in the safe zone when it blows up. Even more ludicrous when said runner uses Commando to stab an enemy hiding behind the claymore...
* In ''VideoGame/JadeEmpire'', one of the characters you encounter is Sir Roderick Ponce von Fontlebottom the Magnificent Bastard (voiced by Creator/JohnCleese) who keeps dueling people with his arquebus called [[ICallItVera Mirabelle]] and, of course, winning, since the people of the [[FantasyCounterpartCulture Jade Empire]] have never seen a firearm (they assume it simply makes fireworks). The player can challenge Sir Roderick and get his weapon after beating him. One of the styles available to the player is sword-fighting.
* While guns in ''VideoGame/DeusEx'' are good weapons, halfway through the game you get a sword that [=OHKOs=] most enemies you meet and allows you to take on bots in close combat.
* ''VideoGame/StarCraft'' has a surprisingly high amount of bladed weapons for a sci-fi game. Protoss Zealots for example can easily cut down most of the conventionally armed Terran Infantry, and the sequel even gives them a charge ability to quickly close the distance.
* In the ''VideoGame/MegaMan'' series, swords tend to do more damage per ammo cost than most ranged attacks to compensate for lack of range. Examples are Slash Claw from ''VideoGame/MegaMan7'' and Flame Sword from ''VideoGame/MegaMan8''.
* ''VideoGame/MegaManX'': Ever Since Zero became fully playable since ''X4'', this trope becomes the player's decision- X's ArmCannon or Zero's LaserBlade. [[spoiler: Also, X v.s. Zero in ''X5''. Whichever weapon comes out on top is decided by the player]].
* Also referred to in ''VideoGame/MegaManBattleNetwork''. Title Character [=MegaMan=] uses an ArmCannon as his signature weapon, while TheRival [=ProtoMan=] makes use of a BladeBelowTheShoulder.
* The [=iOS=] game ''VideoGame/RavenmarkScourgeOfEstellion'' takes place in a StandardFantasySetting with the titular [[TheEmpire Empire of Estellion]] (the strongest nation in this world) has a typical Medieval army (albeit with some Wind and BloodMagic used here and there). However, the neighboring Commonwealth of Esotre has made great strides in technology and alchemy, as their land is much harsher, and survival there requires innovation. Thus, their front-line troops are Fusilier Linesmen armed with single-shot muskets. According to the in-game Codex, Fusiliers usually only get one shot per battle before they close with the enemy and fight hand-to-hand. Thus, their muskets have two bayonets attached to them. In the gameplay, however, they can fire every turn. Fusilier Militia are mostly melee troops, although they can use their Volley ability to fire their muskets every 3 turns. For the most part, Imperial troops do just as well with your typical Medieval weapons like swords, spears, and bows. However, elite Sotran marksmen called Greyjacket Riflemen lower the defense rating of any enemy on a successful hit.
* A futuristic take on the trope from ''VideoGame/{{Strider}}'': Hiryu is the unmatched expert of the Cypher, a LaserBlade which generates an edge of [[AbsurdlySharpBlade white-hot plasma]]. His first rival, the BountyHunter Solo, instead relies entirely on firearms to fight, using a giant plasma gun/cannon, a handgun and other weapons like mines and missiles.
* In ''{{VideoGame/Medabots}}'' this is on display with the JapaneseBeetleBrothers Metabee and Rokusho. Metabee specializes in long-range weaponry including a rifle, sub machine-gun, and ''missile launcher'', while Rokusho's signature weapon is a pair of scissors fashioned into a BladeBelowTheShoulder.
* Can be seen as a theme within ''VideoGame/TotalWarShogun2'', especially if you move from the main game to the last expansion.
** The classic campaign takes place during Japan's Sengoku period, which saw firearms introduced to the country by Western traders. Arquebuses are inaccurate and slow to fire, but dangerous in salvos and good at breaking [[CannonFodder Ashigaru]] units. But since getting gunpowder weapons in great numbers involves either going deep into the tech tree or dishonoring yourself by dealing with foreigners (or worse, converting to Christianity!), for most daimyo it's much more practical to focus on katana-toting samurai, which are extremely effective in close combat.
** But then comes the ''Fall of the Samurai'' campaign, set during the Boshin War. Not only are handheld firearms much more dangerous and widespread, you can also field powerful artillery pieces like [[GatlingGood Gatling guns]]. It's ''possible'' to refuse to modernize and win the game with a "traditional" army, but in most cases bringing a bunch of swords to the battlefields in this era is just asking for a massacre.
* Zigzagged in ''VideoGame/WayOfTheSamurai4''. Gameplay seems to favor the sword a lot more, as swords are more durable and have more devastating techniques, while guns do minimal damage and break after a few uses. But in cutscenes, whenever someone wields a gun, expect another character to be heavily injured or even killed.
* All of the ''Franchise/{{Halo}}'' games feature plasma-sword wielding Elites, alien commanders who charge into battle against gun-toting humans. Multiplayer and campaign missions often see the gun vs sword debate play out literally, when the covenant plasma sword faces a human 8 gauge shotgun. There is even a multiplayer mode called infection dedicated to scatterguns or pistols vs swords.
* ''VideoGame/TeamFortress2'' deliberately omits effective close combat firearms and has melee weapons buffed in its mechanics to make them practical. This culminates in Demoknight loadup which only uses melee weapons but is still pretty competitive.

* ''Webcomic/SluggyFreelance'' compares the two, complete with ''StarWars'' reference, [[http://sluggy.com/comics/archives/daily/20020702 here]]. Judging by [[http://sluggy.com/comics/archives/daily/20020703 the next strip]], Torg ultimately decided a gun ([[MoreDakka or three]]) ''and'' a sword was [[SwordAndGun the best option]].
* During Bob and Mynd's first encounter in ''Webcomic/BobAndGeorge'', Bob, who is armed with a blaster, [[http://www.bobandgeorge.com/archives/010710c mocks Mynd for choosing to wield a lightsaber against him]]. Mynd, in response, [[http://www.bobandgeorge.com/archives/010711c goads Bob into attacking first]], and [[http://www.bobandgeorge.com/archives/010712c as it turns out]], Mynd has shielding to protect him.

[[folder:Western Animation]]
* Part way through episode "War" of ''WesternAnimation/AeonFlux'' Aeon is already dead by this point (not a spoiler, she always dies), and the guy who killed her is making is way through armies of mooks. He is brought up short by a guy doing fancy twirly moves with a sword. He watches for a moment, and sardonically looks at his gun. After a moment, he simply shoots the guy... ''who then deflects the bullet with his blade'' and impales our hero in a single swift move. And onwards...
* ''WesternAnimation/SamuraiJack'' tends to lean both ways with this. Guns in the hands of {{Mook}}s are typically pretty useless against the sword-swinging samurai, but any gun user with training and experience, like the Clench Family and The Scotsman, are able to use them with great effect. The Clenches actually were losing against Jack ''until'' they brandished their guns, which quickly turned the battle in their favor.

[[folder:Real Life]]
* It's a notable historical fact that when guns were first introduced, they were so unreliable that many still preferred swords. Essentially, when pitting a sword against a gun, the gunman had one shot. If he missed (and he usually did), the swordsman had plenty of time to close and cut down the defenseless opponent while he was frantically reloading. Of course this flaw was later corrected, and swords eventually fell out of favor, as guns grew more reliable.
** This is why ''Literature/TheThreeMusketeers'' are primarily remembered for the scenes in which they fight with swords even though their name clearly states that they were the king's elite ''musket'' users.
** Even after guns became more reliable the Hanoverians and Jacobites engaged in a series of bloody experiments to see whether a volley of musketry can do enough damage to disrupt a highland charge. Until ring-mounted bayonets were developed, the charge was fairly effective despite the losses. Afterward, the charge's effectiveness relied heavily on whether or not a large number of screaming men with large swords was enough to demoralize the Crown soldiers.
** And up until the development of more modern cartridge-based firearms, the biggest great equalizer when you've only got time for one shot was the use of [[BayonetYa bayonets]], though that essentially settled the debate in favor of melee. Granted, the initial volley(s) remained every bit as essential to winning the battle as other ranged weapons were in earlier times, the addition of bayonets meant you could give every soldier in your army a gun ''and'' a bayonet instead of splitting melee and firearm roles between different formations, and the development of rifled firearms offered another essential use for guns, creating the prototypical ColdSniper. Though when guns were still muzzle-loading, that rifling [[AwesomeYetImpractical did hinder one's ability to shove the bullet and wadding fully down the barrel.]]
* This trope is the reason Samurai are so strongly associated with swords; initially they were associated with bows and carried swords as sidearms (they fought on horseback, much like the mongols). When firearms were developed and bows became obsolete, the role of katanas was played up (while samurai adopted firearms, so did the peasantry, so they didn't pick up the same association as bows, which require a lot of training to use).
* Some early battles of UsefulNotes/WW1 played out like this. In the opening months of the war, the Germans had settled down into the trenches and had adopted the attrition tactics that [=WW1=] is remembered for; however, what most people forget is that [=WW1=] was an entirely new kind of war, and introduced tactics like tanks, artillery barrages and air support that had simply not existed beforehand. Therefore, the British and French kept trying to use the tactics they had been using in the colonial wars for decades- which were based pretty heavily on cavalry charges to break the lines. The British cavalry relied on their sabres much more than their pistols (because it's hard to aim a gun whilst riding a galloping horse), and some French cavalry regiments did not even carry guns because [[HonorBeforeReason it was ungentlemanly]]; meanwhile, the Germans were tooled up with [[GatlingGood machine]] [[{{Dakka}} guns]]. [[{{Deconstruction}} For an example of how well swords versus guns worked in this situation]], watch the first hour of ''Film/WarHorse''. They eventually learned better, and [=WW1=] changed the face of warfare forever.
** That said, sword-armed cavalry still had one last victory against guns at [[https://en.wikipedia.org/wiki/Charge_of_the_Savoia_Cavalleria_at_Izbushensky Izbushensky]] during UsefulNotes/WorldWarII, when the Italian cavalry regiment, the Savoia Cavalleria, discovered that almost four times their numbers in infantry with artillery support had surrounded them during the previous night and so charged and routed the enemy. That said, everyone involved quickly understood the charge succeeded partly because [[WhoWouldBeStupidEnough the Soviets weren't expecting the Italians to be that crazy]] and partly because the cavalry was armed not just with sabers but also with carbines (indeed, the squadrons who still had to charge supported the charging ones with their guns), pistols, grenades, and, much to the Soviets' surprise, ''light artillery'' (every Italian cavalry regiment was supported by horse artillery).
* And then there's "Mad Jack" Churchill, who fought with a claymore (and not the 'mine' kind) in [=WW2=].[[https://en.wikipedia.org/wiki/Jack_Churchill]]
** He wasn't using the {{Film/Braveheart}} kind of claymore, either. The sword Jack Churchill used was a basket-hilted one-handed affair, not a giant stonking {{BFS}}. [[https://upload.wikimedia.org/wikipedia/commons/d/d2/Jack_Churchill_leading_training_charge_with_sword.jpg A picture of him, sword in hand (bottom right).]]
* While not quite swords, melee weapons as a whole have seen use throughout the Vietnam War and are still in deployment today in some countries; [[https://en.wikipedia.org/wiki/Combat_knife#Post_WWII Knives]], Machetes, Axes, Spears, and even Clubs have seen their fair share of usage as weapons throughout contemporary history alongside modern firearms. Modern military forces are even required minor training for defense against melee weapons, and some in the usage of them.