Deep in space, the Statesman has been attacked by the Sanctuary II, the ship of Thanos. Half of its passengers have been killed by the Black Order, the children of Thanos. One of them, Ebony Maw, announces that the survivors should rejoice in their defeat by Thanos. With Heimdall and Thor unable to even stand, Loki is brought before Thanos himself. Thor, Heimdall, and Loki soon find out that Thanos, wielding the Infinity Gauntlet already accommodating the Power Stone, had begun his quest of hunting down the Infinity Stones personally.
Thanos demands that Loki hand over the Tesseract, threatening to kill Thor if he doesn’t comply. Loki initially hesitates, to which Thanos responds by torturing Thor with the Power Stone. Eventually, Loki can no longer see his brother suffer and reveals the Tesseract – which he had retrieved from Odin’s Vault prior to Asgard’s destruction – much to Thor’s disappointment. However, Loki doesn’t hand it over, and buys sufficient time for Hulk to attack Thanos and save Thor from Thanos’ grasp. Unfortunately, Thanos quickly overpowers and subdues Hulk. Thor attempts to fight Thanos, only to be quickly defeated and immobilized in pieces of metal by Maw. With the Statesman’s surviving members helpless against the power of Thanos, Heimdall saves Hulk’s life by summoning the power of the Bifrost Bridge the last time and teleporting him to Earth and safe from harm.
In retaliation, Thanos kills Heimdall, leaving Thor in anguish. After this, the Tesseract – which had been left on the floor – is handed over to Thanos by Maw. Thanos crushes the Tesseract and inserts the Space Stone within it into his gauntlet. Now in possession of two stones, Thanos orders his children to invade Earth and retrieve both the Mind Stone and the Time Stone. Loki then suddenly interrupts by pretending to pledge loyalty to Thanos. As he does so, he commits the bold yet fatal action of trying to kill Thanos with a dagger.
Thanos sees through Loki’s attempt and foils him with his newly acquired stone, and proceeds to grab him by the neck. Thor only helplessly watches as Thanos breaks Loki’s neck before his very eyes. Thanos uses the Power Stone to destroy the Statesman while he and the Black Order teleport away, leaving Thor to die as he mourns over his brother’s dead body as the ship explodes around him.
Meanwhile, on Earth, Hulk crashes into the New York Sanctum via Bifrost and turns back into Bruce Banner, informing Doctor Strange and Wong about Thanos. Strange and Banner find Tony Stark, who is having a date with Pepper Potts, and bring him to the Sanctum as well. Strange, Wong, Banner, and Stark discuss the Infinity Stones, eventually surmising that Thanos is looking for both the Time Stone, held in the Eye of Agamotto owned by Strange, and the Mind Stone, kept by Vision in his forehead.
Banner insists that Thanos is the most formidable enemy they have ever faced, revealing that he was Loki’s sponsor during the Battle of New York and will wipe out half the universe if he completes the Infinity Gauntlet. Stark suggests simply destroying the Time Stone since they’ve got it on hand, but Strange refuses as he and Wong have pledged to protect it with their lives. Banner asks where Vision is, and Stark admits that he’s lost track of him and that Steve Rogers might know where he is. Stark brings Banner up to date with everything that happened since he left Earth; the Avengers have disbanded, and he is no longer on speaking terms with Rogers. Banner implores Stark to call Rogers, insisting that whatever happened between them doesn’t matter compared to what is coming. Convinced, Stark takes out the phone Rogers sent him after the Avengers Civil War and prepares to make the call.
Before he can, however, an ominous hum rings through the air, accompanied by a change in air flow. A massive, ring-shaped Q-Ship hovers above New York City, causing panic and fear in the streets. Strange manages to shut the ship’s engine off as Ebony Maw and another of Thanos’ children, the hulking Cull Obsidian, approach them. While Strange, Stark, Wong and Banner confront the invaders, the Q-Ship is witnessed from afar by Peter Parker, who rushes in to investigate. A turbulent battle erupts in the streets, but Banner finds himself unable to transform into Hulk, despite his best attempts.
As Wong fights Cull, trapping him in the Arctic with his Sling Ring, Ebony Maw, a fierce telekinetic, successfully abducts Strange, with Time Stone in tow. Unbeknownst to Maw, however, both Iron Man and Spider-Man – who is granted his Iron Spider Armor – manage to stow away in Maw’s Q-Ship. As Wong returns to the sanctum to protect it, Banner finds Stark’s phone and decides to call Rogers himself.
Having survived the vacuum of space after the Statesman’s blast, Thor is rescued by the Guardians of the Galaxy, who received the Asgardians’ distress call. They take him aboard the Benatar, where Thor tells of how Thanos killed half the Asgardians to obtain the Space Stone and decimated Xandar to obtain the Power Stone. Gamora recounts how Thanos traveled from planet to planet, killing half the population of each, and will do the same to the entire universe should he complete the Gauntlet by merely snapping his fingers.
They figure that Thanos will be headed to Knowhere in order to take the Reality Stone from the Collector. Thor decides to leave for Nidavellir, as he intends to ask Eitri to craft him a new weapon capable of defeating Thanos. Thor leaves with Rocket Raccoon and Groot while Star-Lord, Gamora, Drax the Destroyer and Mantis depart for Knowhere.
Meanwhile, Proxima Midnight and Corvus Glaive, two more of Thanos’ children, ambush Vision, who attempts to live a normal life with Wanda Maximoff in Scotland. Vision is deeply weakened in the attack, while Maximoff barely manages to hold her own against both assailants. However, reinforcements arrive in the form of Rogers, Falcon and Black Widow, who have been contacted and filled in by Banner. Together, they force Proxima Midnight and a heavily wounded Corvus Glaive to retreat before returning to the New Avengers Facility.
Remembering how Thanos destroyed half of her people and adopted her in the process, Gamora makes Quill promise that he will kill her if she gets captured by Thanos. Although Quill is reluctant, Gamora makes him promise and swear on his mother. He eventually agrees, and the two share a kiss. As they arrive on a deserted Knowhere, the Guardians of the Galaxy witness Thanos violently interrogating the Collector over the location of the Reality Stone. Unfortunately, the group makes too much noise and Thanos realizes their presence. Gamora goes on the offense, attacking and promptly defeating the Titan, who falls to the ground, seemingly killed.
However, the group discovers that Thanos has already acquired the Reality Stone, and has been using it to cast a massive illusion. He drops the illusion, revealing a burning Knowhere and himself, alive and well. Thanos had expected Gamora to come and fight him, and is aware that she is the only person who knows the location of the elusive Soul Stone. Thanos easily subdues Gamora and incapacitates Drax and Mantis. Quill aims to fire at Thanos’ head, but Gamora begs Quill to keep his promise and kill her, with Thanos pushing Gamora against the gun, inviting him to do so. Despite his heartbreak, Quill pulls the trigger, only for the gun to shoot harmless bubbles, thanks to the Reality Stone. Thanos then teleports away with Gamora.
Back at the facility, James Rhodes discusses recent events with Thaddeus Ross, who is outraged at Vision’s recent disappearance. Rhodes counters that Vision is only missing because of the Sokovia Accords, which even he now regrets signing. Rogers, Wilson, Romanoff, Vision, and Maximoff arrive, and Ross demands they all be arrested. Rhodes cuts his transmission off, an act which will likely end his military career, and greets his old teammates.
Banner emerges as well, sharing a brief reunion with everyone. After bringing everyone up to speed, Banner suggests calling in Hawkeye for help, but Romanoff explains that he as well as Scott Lang are unavailable, having surrendered themselves to the US government, making deals to be placed under house arrest with their families. Together, the team decides that the Mind Stone must be destroyed and that Maximoff is the only member powerful enough to do so. However, in order to destroy the stone without killing Vision, Rogers suggests traveling to Wakanda. In Wakanda, T’Challa and Okoye deliver a new vibranium arm to Bucky Barnes, who has recovered from his mental programming. They warn him that a battle may be coming as they are providing refuge to the Avengers who will undoubtedly be followed by Thanos’ children.
In Ebony Maw’s Q-Ship, Stark and Parker successfully rescue Strange by blowing a hole in the ship’s hull, fatally shooting Ebony Maw into space. While Strange advocates returning to Earth, Stark suggests keeping the course set on Titan in an effort to keep an element of surprise over Thanos. Strange agrees but warns Stark that he will have to protect the Time Stone, even if it means sacrificing him or Parker.
On the Sanctuary II, Gamora tells Thanos that she doesn’t know the location of the Soul Stone and calls her adoptive father insane for planning to exterminate half of all life in the universe, though Thanos insists on the righteousness of his ultimate desire for “perfect balance”. He informs Gamora that her home planet Zen-Whoberi has been thriving since he eradicated half of its population. As Thanos needs the Soul Stone to fulfill his goal, he reveals that Nebula is his prisoner. Thanos tortures Nebula in front of Gamora, slowly pulling her body apart. Unable to bear it, Gamora reveals that the Soul Stone is hidden on Vormir.
Meanwhile, Thor, Rocket Raccoon and Groot land in Nidavellir, where the forges have gone frozen and dark. They encounter Eitri, now the only remaining Dwarf on the forge, and he explains that Thanos ordered him to craft the Infinity Gauntlet, crippling the Dwarf afterward so he could never forge anything else. However, Thor convinces Eitri that, working together, they have the power to defeat Thanos. In order to do so, they plan on crafting a new weapon for Thor – Stormbreaker, a weapon that can summon the power of the Bifrost. On Sanctuary II, Nebula manages to free herself and sends a message to the Guardians of the Galaxy, imploring them to meet her on Titan.
Stark, Strange and Parker barely manage to land the Q-Ship on Titan’s surface, where they are immediately ambushed by the Guardians, who have mistaken them for Thanos’ minions. After a few tense moments where Quill believes Stark and his companions to be in league with Thanos, they all agree to work together. While the rest of the group tries to devise a plan, Strange uses the Time Stone to look into alternate futures. He then reports to his allies: out of the fourteen million six hundred and five visions of the future that he foresaw, they were victorious in only one alone.
Thanos and Gamora teleport to Vormir, where they are greeted by Red Skull, now acting as a keeper for the Soul Stone after being banished there by the Tesseract in 1945. Schmidt tells Thanos that he must sacrifice what he loves the most in order to obtain the stone. Gamora is sadly amused, as she believes that Thanos does not love anyone or anything, making him incapable of completing the sacrifice or fulfilling his plans. When she sees that he is crying, she is incredulous at first. Schmidt tells her he isn’t weeping for himself, but for her. Thanos sacrifices his daughter by throwing her from the cliff to her death and later awakes in possession of the Soul Stone.
Meanwhile, the Avengers take Vision to Wakanda, where they are greeted by T’Challa and Barnes. They ask Shuri if she can safely extract the Mind Stone from Vision and she confirms that she can, but that it will take some time. Maximoff is ordered to stand by at the operation table, ready to destroy the stone once it’s free. Moments later, massive drop ships land outside of Wakanda’s protective energy dome. Meanwhile, Thor and Rocket successfully revive the star core of Nidavellir, but due to the mechanisms of the forge being damaged, Thor is forced to risk his life, using his own body to hold the forge’s iris open.
As massive armies of Outriders led by Proxima Midnight and Cull Obsidian arrive in Wakanda, T’Challa gathers Dora Milaje, Wakandan Royal Guard, the Border Tribe and the Jabari Tribe led by M’Baku, accompanied by Rogers, Barnes, Wilson, Rhodes, Romanoff and Banner using a suit of Hulkbuster armor, to meet them, hoping to buy Shuri enough time to complete her work. At first, the Outriders blindly throw themselves against the protective energy dome surrounding Wakanda, with many perishing against the dome’s surface and only a few actually making it through.
However, once the Outriders begin to move around the edge of the dome, Banner alerts the team that the beasts could potentially flank them, gaining a clear path to Vision. T’Challa decides to partly open the barrier in an effort to keep the enemies in front of them. The strategy is effective, but at the cost of massive hordes of Outriders suddenly invading Wakanda, quickly starting a fierce battle.
While Thor and Rocket are able to break the ice that immobilizes the rings of Nidavellir’s forge, the mechanism that focuses the neutron star’s power is damaged. Thor exposes himself to the full power of the star, giving the forge enough time to melt the special metal needed to craft Stormbreaker. Thor is left near death, and while Eitri successfully molded the metal, the axe’s handle cannot be found. Groot sacrifices his left arm for the weapon’s handle, activating its powers and reviving Thor.
Although they are able to take down many of hostiles, the Avengers and Wakandan armies are quickly outnumbered and overrun by the Outriders. However, Thor arrives via Bifrost with Rocket and Groot, using Stormbreaker to turn the battle in favor of the defenders of Earth. He demands to have Thanos brought to him so he can enact his revenge.
Thanos arrives on Titan and is greeted by Strange. During a brief conversation with Strange, he reveals that Titan was his home and that overpopulation led it to ruin. Thanos had suggested that half the population be killed at random to save the planet, a suggestion which was obviously seen as insane. Thanos now believes himself to be merciful as he plans to simply snap his fingers after acquiring all six Infinity Stones and cause half the universe’s population to cease to exist without causing much pain, after which Thanos plans on simply resting.
Nevertheless, they engage Thanos in an intense battle but Thanos single-handedly repels the assaults of the Avengers, the Guardians, and Strange until Nebula arrives and distracts him. Eventually Strange, Parker and Drax manage to pin down Thanos’ limbs while Mantis uses her powers to put him to sleep. Although she fails and he remains half-conscious, he is still weakened enough that he is totally incapacitated allowing Stark to try and force the Gauntlet off Thanos’ hand. However, when Nebula deduces that Thanos has killed Gamora, Quill becomes enraged and attacks the Mad Titan, causing him to regain consciousness just as the Gauntlet was about to be taken off.
The fight turns decisively in Thanos’ favor as he unleashes the full might of the Infinity Stones upon his attackers, swiftly repelling them all. Thanos then confronts and overpowers Strange but realizes that Strange never used the Time Stone in the fight because Strange hid it. Before he can try to locate it, Iron Man attacks him, but is quickly outmatched and seriously wounded when Thanos stabs him in the stomach. As Thanos prepares to execute Stark, Strange agrees to hand over the Time Stone to Thanos in exchange for Stark being spared. Thanos agrees and inserts the Stone into the Gauntlet and departs to retrieve the last Stone. Stark asks Strange why he would sacrifice the Time Stone just to save him.
In Wakanda, the Black Order launches Threshers, massive siege weapons which lay waste on the battlefield, prompting Maximoff to join and save Romanoff and Okoye. However, what no one has realized is that Corvus Glaive has successfully infiltrated the lab where he knocks out Shuri and her guards before the extraction of the Mind Stone can be completed. Glaive then attempts to take the Mind Stone from Vision who flees on to the battlefield and attempts to fight back, but Corvus Glaive and Cull Obsidian overpower him.
Banner arrives and manages to kill Cull Obsidian despite still being unable to turn into Hulk while Rogers fights against Corvus Glaive. Meanwhile, despite holding her own against the combined forces of Maximoff, Romanoff and Okoye, Proxima Midnight is killed as well when Maximoff forces her into the path of a Thresher. Rogers is defeated, but Vision stabs Corvus Glaive with his own weapon from behind, killing him. With the Black Order defeated and the Outriders routed by Thor, the Avengers seem victorious.
However, Thanos teleports to Wakanda as well to obtain the Mind Stone. All the Avengers, Okoye, T’Challa, and Groot gather to defend Vision, but Thanos effortlessly defeats them one by one, including Rogers, who is briefly able to hold back Thanos, much to the Titan’s surprise. Realizing that they have no other choice, Vision asks Maximoff to destroy the Mind Stone herself, which will likely kill Vision.
She reluctantly agrees and successfully shatters the Mind Stone moments before Thanos can get it, vaporizing both it and Vision. However, Thanos uses the power of the Time Stone to reverse time and restores both Vision and the Mind Stone, ripping the Mind Stone out from Vision’s skull, killing him for good. Having finally gathered all six Infinity Stones, Thanos prepares to execute his plan, but Thor arrives and catches Thanos off guard, unleashing his full power and the full might of Stormbreaker upon the Titan in a last-minute attempt to stop him, severely wounding Thanos as Stormbreaker buries itself in his chest.
However, Thanos survives the attack. He mocks Thor for not having hit him in the head and snaps his fingers in the Gauntlet, completing his plan. Thanos is momentarily transported into the Soulworld, where he sees a younger Gamora, who asks what the cost of achieving his goal was. Sadly, Thanos admits that it has cost him “everything”.
Thanos then returns to the real world, with the Gauntlet now mangled from the massive amount of energy used, and Thor furiously questions Thanos about what he did as a rumble can be heard throughout the universe. Thanos simply smirks at him and teleports away. As Thor is left to wonder what the outcome will be, Barnes suddenly turns to ash in front of Rogers. The effects of the snap manifest: half of the Wakandan army disintegrates as does T’Challa, Groot, Maximoff, and Wilson, leaving the survivors, regrouping around Vision’s body, to look in horror and unable to do anything but accept defeat.
On Titan, Mantis, Drax and Quill vanish, along with Strange, who tells Stark that there was “no other way”. Parker is the last to vanish and tearfully begs Stark not to let him go. While a traumatized Stark laments his failure, Nebula, the only other survivor, solemnly remarks that Thanos has achieved his goal. Thanos retires himself on a distant planet and rests while satisfactorily gazing out to the sunrise, considering his job done and smiling slightly at his triumph.
In a post-credit scene, Nick Fury and Maria Hill are monitoring the battle in Wakanda when they witness the effects of the Snap: an SUV crashes in front of them and when Hill looks inside, the driver has vanished. A helicopter crashes into a nearby skyscraper, seemingly pilotless. When Hill turns to dust in front of him, Fury grabs an old-fashioned pager and prepares to send a distress signal. When he starts to vanish as well, Fury laments his death but manages to activate the Pager, which displays a star pattern with a blue and red background.