In Avengers: Endgame, every superhero from every phase of the Marvel Cinematic Universe united to bring Thanos to justice. Even the ones that the Mad Titan turned to dust at the end of Infinity War came back in the final battle of Endgame after being magically resurrected by the Hulk.

RELATED: Avengers: Endgame – 5 Ways It Sticks To The Marvel Formula (& 5 Ways It Deviates From It)

But some heroes contributed more in the fight against Thanos than others. Every little helps, but Tony Stark made the ultimate sacrifice and Captain Marvel arrived at the perfect time as a human “deus ex machina.”

Hawkeye

Hawkeye aims his bow at Outriders in the tunnel in Avengers Endgame

When Thanos flies through the Avengers’ time portal and destroys their headquarters, he sends his mindless alien goons – the Outriders – into the rubble to recover the Infinity Stones.

There, Hawkeye becomes the first in a long line of heroes to keep the Iron Gauntlet out of Thanos’ hands. He’s chased out of the debris of the destroyed Avengers HQ by ravenous Outriders.

Captain America

Cap hits Thanos with Thor's hammer in Avengers Endgame

Steve Rogers is prepared to face Thanos and his armies alone before the portals start opening up. With Tony Stark and Thor knocked out of commission, the Mad Titan’s forces bear down on Steve. But he refuses to give up. He tightens the strap on what’s left of his shield, ready to face this entire intergalactic army alone.

Then, the Masters of the Mystic Arts open up portals and bring him dozens of superheroes and hundreds of footsoldiers as backup. Cap proceeds to galvanize every hero from the entire MCU with his familiar catchphrase from the comics: “Avengers... assemble.”

Wong

Wong opening portals in Avengers Endgame

After being introduced as the titular sorcerer’s wisecracking sidekick in Doctor Strange, Wong has been popping up all throughout the MCU’s Phase Four. He bumped into Shang-Chi at an underground fight club, he warned Spider-Man about meddling in multiversal matters, and he helped Strange to save America Chavez from the Scarlet Witch.

Wong makes one of the most significant contributions to the final battle in Endgame, because he provides the Avengers’ forces. Before Wong opens up portals to bring the heroes to the battlefield, the only person standing against Thanos is Steve Rogers.

Nebula

Nebula prepares to fight in Endgame.

Nebula’s journey from villain to hero was completed in Endgame. After becoming a Guardian of the Galaxy and promptly losing all the other Guardians (except for Rocket), Nebula became an Avenger.

During the final battle, Nebula uses her knowledge of the future to turn the Gamora from Thanos’ timeline – one of his greatest assets – to the Avengers’ side.

Ant-Man

Ant-Man jumps on a pencil in Avengers Endgame

Throughout the final battle, Ant-Man and the Wasp try to get the Quantum Tunnel in the back of Luis’ van fired up to send the Infinity Stones into the Quantum Realm where Thanos can’t get to them.

RELATED: 10 Ways Ant-Man 3 Could Be The Ragnarok Of The Ant-Man Franchise

This side mission ends up being moot, but Ant-Man had already contributed more than enough to the fight against Thanos within the first act of the movie. Scott Lang is the one who came up with the “Time Heist” idea that made the Avengers’ victory possible.

Scarlet Witch

Wanda lifts two boulders with her powers in the MCU

Wanda Maximoff recently showed off the extent of her powers when she used chaos magic to embody her multiversal self, then broke into the Illuminati’s headquarters and massacred all of Earth-838’s greatest superheroes in quick succession.

Fans first got a glimpse of that power when she confronted Thanos on the battlefield and told him, “You took everything from me.” This younger version of Thanos from a different timeline tells her, “I don’t even know who you are,” and she quips, “You will,” before unleashing her powers. Wanda doesn’t manage to defeat the Mad Titan, but she does slow him down and force him to resort to his last-ditch anti-Avengers plan.

Black Widow

Black Widow's death in Avengers Endgame

Natasha Romanoff isn’t present in the final battle of Endgame, but she’s there in spirit. Without her sacrifice, the Avengers wouldn’t have collected all six Infinity Stones and their anti-Thanos operation would be moot.

When Nat went to Vormir with Clint Barton to collect the Soul Stone and Red Skull explained that one of them had to die to acquire it, Nat didn’t hesitate to give her life in the quest to bring everybody back.

Doctor Strange

Doctor Strange signals Tony Stark in Avengers: Endgame.

Alongside Wong and the other Masters of the Mystic Arts, Doctor Strange helps to open up all the portals that bring every hero from the MCU into the wreckage of Avengers HQ to battle Thanos and his armies.

RELATED: 10 Strangest Things That Happened In Doctor Strange In The Multiverse Of Madness

In the midst of the battle, a wall breaks down and a tidal wave manages to crash through. Before the water drowns everybody in the warzone, Strange casts a spell to hold it in place.

Captain Marvel

Brie Larson as Carol Danvers smiling in Avengers Endgame

Captain Marvel acts as a human “deus ex machina” – or “god from the machines” – in the final battle of Endgame. After being relentlessly beaten down by the Scarlet Witch, Thanos resorts to firing all his cannons on the battlefield, wiping out both sides of the skirmish.

Then, at just the right time, Carol Danvers soars through the sky and punches her way through the Mad Titan’s entire fleet, disabling the cannons and giving the Avengers a fair chance of winning.

Iron Man

Iron Man snaps his fingers wearing his version of the Infinity Gauntlet in Avengers: Endgame

Just when it seems like the Avengers have lost and Thanos is about to tear down the entire universe, Iron Man absorbs the Infinity Stones into his own Iron Gauntlet and channels their energy for a finger-snap of his own.

Bringing his arc full circle with a reprisal of the “I am Iron Man” line, Tony Stark turns Thanos and his reinforcements to dust and leaves the existing universe intact.

NEXT: Iron Man's 10 Best Team-Ups In The MCU