Set in 2014, five years after the "Manhattan Incident" (the events of the Plant chapter from Metal Gear Solid 2), Metal Gear Solid 4 portrays a world where the restriction of military intervention on foreign soil has been eased, fueling the need for private military companies (PMCs) to fight proxy wars for business purposes. Nanotechnology has become prominent, both to enhance the capabilities and enforce the loyalty of mercenaries. The five largest of these PMCs are owned by a single mother company named Outer Haven, which is operated by Liquid Ocelot. Amassing an army whose manpower rivals that of the United States, Liquid prepares to launch an armed insurrection. With the world once again in crisis, a rapidly aging and disillusioned Solid Snake is deployed into the Middle East by Roy Campbell to terminate Liquid.
After evading the new Metal Gear 'Gekko's, 'Old Snake' finds equipment left for him by close friend and colleague Otacon which enables him to sneak through the warzone. On his way to meet his contact, Snake meets a gun launderer named Drebin who provides the Militia with uncoded weapons, and offers his services to Snake. Snake then makes a rendezvous with Rat Patrol 01, led by none other than Meryl, daughter of Roy Campbell, who Snake had fought alongside at Shadow Moses years before. However, Rat Patrol and Snake have to make a hasty getaway when Liquid's private troops, the FROGS, arrive on the scene. Shortly afterwards, Snake locates the Praying Mantis PMC camp and comes face to face with Liquid. Just as he prepares to shoot his nemesis, Snake and the entire camp all begin to suffer some kind of strange attack. Clutching their heads in agony, the soldiers begin to attack each other and undergo a breakdown, including Meryl and Rat Patrol (but except for 'Akiba' one of the squad members). Barely able to stand, let alone point his gun, Snake collapses while Liquid escapes. But while Snake lies in pain, he meets a familiar face - Dr. Naomi Hunter who had injected him with the FOXDIE virus during the Shadow Moses operation. Apparently in league with Liquid, Naomi gives herself an injection that seems to keep her immune while Snake is carried to safety by Akiba.
Recovering on the Nomad, the plane where Otacon and Snake operate from, Snake watches an encrypted video message sent by Naomi who claims to have been captured by Liquid and is being held in South America. In order to discover Liquid's next move and rescue Naomi, Snake heads to that region and navigates the surrounding wilderness. Along the way, Snake encounters Vamp, the apparently undead member of former unit Dead Cell who had been involved in the 'Manhatten Incident'. With him, one of the 'Beauty and the Beast Unit' called Laughing Octopus. Once again using the warzone as cover, Snake meets Naomi again at her lab where Naomi examines Snake's body. She concludes that his rapid ageing is simply the lifespan that the Patriots chose to give him, to stop him reproducing or his body falling into enemy hands. However, there is worse to come when Naomi reveals that FOXDIE, although currently stable (with no targets left to attack) will soon start to mutate and attack indiscriminantly thanks to Snake's deterioration. Though he may have 6 months left to live, there are only 3 months before Snake becomes a walking biohazard. Only his death will stop the virus. Also, Snake comes to believe that another virus has been injected into his system, but before he can work out why, Naomi is taken by the FROGs and Laughing Octopus attacks Snake in the lab, using a series a deceptions and tricks to catch him out.
Once Snake defeats Octopus, he tracks Naomi and her captors to a heliport. Drebin arrives in his APC and the three of them escape from a horde of pursuing Gekko. During their escape, they encounter none other than Raiden, the former child soldier who defeated Solidus at Manhatten, but now enhanced by an exoskeleton. Raiden and his old enemy Vamp fight in the street, with neither apparently being able to die, before Raiden jumps aboard Snake's helicopter, ending the second act.
After the mission in South America, Otacon and Snake learn that Liquid is after the remains of Big Boss once again and plans to use his genetic information to access the centre of the Patriots' control, an AI system called JD. This is followed by Naomi's revelation that Big Boss' cells are STILL alive while his mind is kept inactive by nanomachines. Raiden had recovered Big Boss' body, previously, for a mysterious leader referred to as 'Big Mama' and that the body is currently in Europe. Snake and Otacon, who has developed a romantic relationship with Naomi, travel to Europe in order to intercept Liquid. Snake tracks down the resistance leader 'Big Mama' who reveals herself as EVA, surrogate mother of Liquid and Solid Snake and a major part of Operation Snake Eater in the 1960s. It is here that Snake learns the Patriots' origins; the organisation was founded by Major Zero, Big Boss' fomer commander during that same mission. The aim was to create a world that would continue the will of 'The Boss', but the two men disagreed over their interpretation of this and when Zero arranged the 'Les Enfants Terribles' program (the cloning of Big Boss), the two became enemies.
When the PMC attacks the hidout, EVA and Snake try to escape with Big Boss' remains but are held up by 'Beauty and the Beast' member 'Raging Raven', who Snake has to fight. But while they are delayed, Liquid gets to Big Boss first and then burns the body. EVA is burnt, desperately trying to save the remains and Snake is pummeled by his brother who now has control over SOP (the Sons of the Patriots system which controls the nanomachines of soldiers and the order of battle). The hundreds of American troops that show up to cut Liquid off are all taken out, with Meryl and Akiba almost getting drowned in the river. Snake's face is burnt badly and EVA dies in his arms, while Liquid gets away once again.
Thanks to a Mk.II robot aboard the enemy's boat, Otacon finds out that Liquid's ultimate goal is to launch a nuke into orbit and destroy JD. This would automatically hand down control to the next AI system, GW - the system that Liquid has salvaged from Arsenal Gear. This would essentially give complete control of the Patriots' system to Liquid. To do this without the Patriots' AI catching on, Liquid plans to use a rail gun to launch a 'stealth nuke' and the only rail gun capable of this is attached to Metal Gear REX, which is still at Shadow Moses where Snake had fought it years before.
The nuclear disposal facility on Shadow Moses is still intact when Snake returns there but is totally overrun by Gekko and small robotic drones. Working his way through the facility, old memories return and even comes back to life when Snake encounters Crying Wolf (instead of Sniper Wolf) on the snowfield. The 'Beauty and the Beast' member tries to attack from Snake from downwind and shoots at him using the same rail gun that Dead Cell Fortune (from MGS2) had previously carried. Finally Snake defeats her and makes his way to the underground base where REX is held. But the rail gun has already been taken and while Otacon uses the Mk.III to reactivate Metal Gear's system and track it, Naomi appears and Vamp attacks Snake in the hanger. Using a syringe that Naomi provided earlier on, Snake injects Vamp causing his nanomachines to stop healing his wounds - essentially making him 'mortal' again. Just at that moment, Raiden arrives having recovered and challenges Vamp to a final showdown with knives. While they battle on REX's top, Snake holds off a swarm of Gekko with Wolf's rail gun. Raiden defeats Vamp once and for all and the conflicted Naomi commits suicide by using the syringe to supress her own nanomachines, which had been staving off cancer until now. Otacon, distraught, manages to activate REX and Snake, Raiden and the Mk.III escape the base.
Snake pilots REX out onto the docks, but Raiden gets crushed by falling debris. Awaiting Snake is Liquid, armed with another Metal Gear, the amphibious RAY. After an epic duel, Snake destroys RAY and Liquid runs for the ocean to be greeted by his HQ - a gigantic prototype of Arsenal Gear, dubbed 'Outer Haven'. Just as Outer Haven rams into the dock, Snake is saved by Raiden who pulled himself from under the wreckage. Raiden presses against Outer Haven and manages to stop it from crushing Snake but is severely wounded afterwards.
Once regrouped, Snake, Otacon and Meryl are picked up by a Navy battleship which is captained by Mei Ling, one of the consultants during the original Shadow Moses mission. While Liquid prepares to launch the nuke from Outer Haven, the battleship gives chase across the Bering Sea and Snake boards the headquarters with Meryl and Akiba. Here, they meet the final 'Beauty and the Beast' member, Screaming Mantis who uses telekinesis and nanomachine control to turn Meryl against Snake. Akiba saves Meryl and Snake beats Mantis by supressing his nanomachines. Akiba professes his love for Meryl and even proposes during a massive gunfight, while Snake must go through a corridor filled with microwave emmiters in order to reach GW's core. Near death, Snake reaches the core and Otacon plants a worm cluster to deactivate GW. But something else happens... the entire AI system shuts down and Naomi, in a video message, reveals that the virus used GW as a means to infect the whole Patriots system. Snake passes out and wakes up at the very top of Outer Haven... with Liquid Ocelot. Ocelot tells Snake that in order to shut down the Patriots, he had to fool the AI into thinking he really was Liquid Snake. The Patriots had to believe that Snake was just after Liquid and that he wouldn't actually shut down the whole network. Ocelot tells Snake that he brainwashed himself into becoming Liquid as part of his scheme to ultimately take down the Patriots. All that is left is for Liquid and Snake to have one final battle, which Snake eventually wins, but not before Ocelot's own personality breaks through.
On their return home, Meryl and Akiba get married on an airfield while Colonel Campbell manages to reconcile with his daughter. All are present except for Raiden and Snake. Raiden is in a hospital and in a completely new prosthetic body. He makes amends with Rose and meets his son, John.
Snake visits the cemetary and the gravestones of both Big Boss and his mentor, The Boss. With his mission complete, Snake must endure 'one final punishment' to prevent the FOXDIE virus from mutating into an epidemic. But Snake is stopped - by a living, breathing Big Boss.
Big Boss reveals to a bewildered Snake that he had indeed been kept alive by EVA but instead of being burnt on the river in Europe, his body switched with the corpse of Solidus Snake (the clone closest in appearance) and was recreated with stem cells taken from both Liquid and Solidus' bodies.
Along with him, Big Boss was brought a wheelchair-bound Zero and shows regret over the chaos that has spawned from their personal feud. He suffocates Zero and reveals to Snake that he too is about to die thanks to a new strain of FOXDIE that Snake has unwittingly been carrying, administered by Drebin in South America (who had been working for the Patriots system all along). It was designed to kill all the surviving founders of the Patriots; EVA, Ocelot and Big Boss and it succeeded. But for Snake, it has had a different effect - it supressed the original FOXDIE from mutating or growing, allowing Snake to live out his remaining months without becoming dangerous. Finally as he rests against his own gravestone, Big Boss makes peace with his last son, his final words being "This is good... isn't it?"
Snake then promises to live his remaining days free of battle, free of cigarettes, and in peace with Otacon and Sunny, Olga Gurlukovich's daughter.