WARNING: The following article contains major spoilers for Avengers: Endgame, in theaters now.

As anyone who has been paying attention might expect, there's a lot to unpack from the finale of Avengers: Endgame. The Marvel Studios sequel does more than conclude the struggle that began in Infinity War, it ends several storylines, some of which began more than a decade ago. More than 30 superheroes appear during the climactic battle, and just as everyone hoped it would, their effort leads to the epic defeat of Thanos.

RELATED: How Quickly Will Avengers: Endgame Earn $1 Billion Worldwide?

The film then says its final goodbyes to three of the heroes that began the Marvel Cinematic Universe: Iron Man, Captain America and Thor conclude their respective journeys as Avengers. The ending is a wild ride in itself, offering moments that are both heartbreaking and heartwarming. So let's explore it and see where Avengers: Endgame leaves the MCU.

FROM THE ASHES...

Thanos' Snap Has a Statistics Problem: Why Did Those Avengers Survive?

Right after Hulk snaps all of the fallen back into existence using the recovered Infinity Stones and the Tony Stark-manufactured gauntlet, Thanos arrives. With everyone else buried beneath rubble or otherwise incapacitated, Captain America, Iron Man and Thor march into battle against the Mad Titan. They put up a fight, but Thanos proves to be far too strong, even without the Infinity Stones. Thankfully, just when it appears the three heroes are on the verge of losing again, the cavalry arrives.

Doctor Strange musters all of the heroes Earth had to offer: an entire army of superheroes and Wakandan fighters, most of whom were turned to dust at the end of Infinity War. We're talking about Falcon, Black Panther, Shuri, Wasp, the Guardians of the Galaxy, Scarlet Witch, Spider-Man and so many more. As the wall-crawler explains, the last thing any of them remember is turning to dust, and yet no time is wasted getting back into the fight. Together, the Avengers are able to hold back Thanos and his Black Order as the heroes try to send the Infinity Stones back through time to where they were retrieved earlier in the film. Unfortunately, the Mad Titan is able to snatch the Stark gauntlet and once again threaten all life in the universe.

HE IS IRON MAN

Robert Downey Jr as Tony Stark in Iron Man header

Tony Stark tackles the Mad Titan but is easily thrown off. Unknown to Thanos, however, the attack wasn't entirely fruitless. Because the new Infinity Gauntlet was created by Stark and seems to behave like his newer, more fluid Iron Man suits, Stark is able to quickly acquire all of the Infinity Stones without Thanos' notice. The villain only realizes when he tries to snap his fingers again, punctuating what would have been an incredibly cold line if the snap had worked.

RELATED: Avengers: Endgame Is Certified Fresh on Rotten Tomatoes

That's when Stark reveals his fist, adorned with the glowing Infinity Stones. He knew the Mad Titan would never accept defeat so long as he drew breath, so Stark uses the stones to snap Thanos and seemingly everyone loyal to him from existence. Sadly, that final act of heroism costs Tony Stark his life. Just one of those stones is capable of completely destroying anything that isn't a Celestial, and Tony was holding six of them. The superhero spends his final moments with Peter Parker and Pepper Potts

RETURNING THE INFINITY STONES

In Endgame's second act, the Avengers acquire the Infinity Stones by traveling back through time to key moments and locations in the MCU: Iron Man, Captain America and Ant-Man take the Mind Stone from New York City in 2012, and the Space Stone from 1970; Hulk receives the Time Stone from the Ancient One in 2012; Hawkeye is granted the Soul Stone through Black Widow's sacrifice; Thor and Rocket Raccoon take the Aether (and Mjolnir) from Jane Foster on Asgard in 2013; and, finally, Nebula and War Machine acquire the Power Stone from Morag in 2014.

As the Hulk learns from the Ancient One, the Avengers could use the Stones without upsetting reality itself so long as each one is returned afterward to its respective time. They attempt to return them mid-battle in the third act, but Thanos disrupts those plans. With the Mad Titan finally out of the way, the Stones can be taken back to their proper times.

After the funeral of Tony Stark, Bruce Banner and Rocket rebuild the time machine that Thanos and Nebula destroyed. Steve Rogers volunteers to take the Infinity Stones, as well as Mjolnir, back through time to where, and when, they came. Although he also takes the opportunity to live out the life he missed, with Peggy Carter, Steve presumably succeeds in returning the Stones and the enchanted hammer, meaning this reality no longer has any Infinity Stones.

WHERE TO NEXT?

Tony Stark standing next to Steve Rogers in Avengers Endgame

Iron Man met his end in the final battle against Thanos, Black Widow perished on Vormir, and Vision remains broken, but what about the other Avengers? After the battle and the funeral, the futures of many of the characters are left a mystery. Hulk will likely continue to provide aid wherever and however he can, especially now that he possesses the intelligence of Banner and the strength of his green alter ego.

RELATED: Avengers: Endgame Reviews Call It a Fitting End to the Infinity Saga

Thor steps down as king of Asgard, now based in Norway, and bestows the title on Valkyrie. Throughout the Thor films, the god of thunder has displayed little interest in his birthright. It only makes sense that he would choose instead to fight alongside others instead of reigning over a peaceful city. With the fate of the Avengers uncertain, Thor chooses to seek out adventure with the Guardians of the Galaxy.

As for Captain America, he lived a long and happy life with Peggy Carter after all. The final scene of Avengers: Endgame shows Steve and Peggy in a suburban house, slowly dancing to a mellow tune. The scene is a reference to Captain America: The First Avenger, in which the two tried to hold on to hope just before Steve crashed into the ice, by promising each other a dance.

That doesn't mean the world will say goodbye to Captain America, as an elderly Steve appears on a bench next to the time machine to pass the unbreakable shield on to someone else: Sam Wilson.

Directed by Joe and Anthony Russo, Avengers: Endgame stars Robert Downey Jr. as Iron Man, Chris Evans as Captain America, Mark Ruffalo as Bruce Banner, Chris Hemsworth as Thor, Scarlett Johansson as Black Widow, Jeremy Renner as Hawkeye, Brie Larson as Captain Marvel, Paul Rudd as Ant-Man, Don Cheadle as War Machine, Karen Gillan as Nebula, Danai Gurira as Okoye and Bradley Cooper as Rocket, with Gwyneth Paltrow Pepper Potts, Jon Favreau as Happy Hogan, Benedict Wong as Wong, Tessa Thompson as Valkyrie and Josh Brolin as Thanos. The film opens Friday worldwide.