Spoilers forAvengers: Endgame ahead.

Marvel did it! They ended the Infinity Saga after ten years and twenty-three movies. It is a cinematic feat never before achieved in the history of film and unlikely to happen again any time soon.

The Avengers defeated Thanos and his hordes of deep space nightmares. Captain America went back in time and lived out his remaining years with Peggy Carter. Bruce Banner and the Hulk managed to work out their differences and merge their personalities. Black Widow gave her life for her adopted family, while Hawkeye regained the family that he lost. And Tony Stark, well, he took on the burden of the Infinity Stones, snapped his fingers, and sacrificed his life to save the universe by erasing the bad guys from existence.

Recently, Marvel Studios President Kevin Feige spoke to Empire Magazine about his experience telling Robert Downey Jr. that the character that he’s been embodying for a decade was being killed off:

“I remember pitching that to Robert Downey Jr. probably in December of 2015, I think. I pitched him the idea of the two-part finale for Avengers and Spider-Man: Homecoming, which was a part of that leading into it. It took a little while, but eventually it came together. I think at first it doesn’t seem real that this journey will come to an end. But as it got closer to filming, it really was emotional for all of us, and particularly for him.”

How could you even plan for the death of such an important character, the one who in a sense sparked the Marvel Cinematic Universe, you ask? Feige said that they looked to those that came before for inspiration. And what better place than the X-Men franchise where Feige got his start in the movie business working as Producer Lauren Shuler Donner’s assistant?

The Marvel Studios head honcho explained that they looked at actor Hugh Jackman’s final bow as Wolverine in the film Logan for insight. Jackman played the character for 17 years before closing his run out with an emotionally satisfying death scene. Feige said:

“We saw Logan like the audience did, in a theater having nothing to do with the making of that film and went, ‘Oh my god, what an amazing ending for Hugh as this character.’ And there are only a handful of examples where an actor so associated with a character can go out perfectly. That’s what we desperately wanted to give Robert, and that was what our focus was on.”

I think we can all agree that they succeeded.

‘Nuff said.