Director Ryan Coogler's Black Panther had a strong ending, giving a poignant goodbye to Michael B. Jordan's Erik Killmonger while also setting up a possible sequel and the movie's impact on the wider Marvel Cinematic Universe. However, Black Panther almost had a much different ending.

Black Panther co-editor Michael Shawver spoke to CinemaBlend and explained how the movie's original ending evolved over time. Shawver revealed a key Killmonger line was cut. "What we shot originally," he said, "and in the script, was Killmonger saying 'It's beautiful, but what are you going to do for everybody in the world who can't see this? And it was great. It was powerful, it was awesome, but it was problematic for a few reasons."

RELATED: Black Panther: Here Are Its Betting Odds to Win the Oscar For Best Picture

It's no secret that Black Panther nearly ended with the United Nations scene that eventually ended up in the mid-credits, but apparently, Killmonger's line didn't fit with this scenario. Shawver continued, "One, we realized that just as a character, for the journey of T'Challa, he can't get the answer to the movie and what he needs to do from the villain - like straight-up exactly what he needs. And that's kind of what was happening. Secondly, it was a great performance, and [Michael B. Jordan] brought it, and it was painful to watch because you kind of don't want this guy to die, but it didn't fit his character."

Retooling for the perfect ending, Coogler and Shawver turned to Hollywood to find an alternative and looked at the atmospheric climax of Francis Ford Coppola's The Godfather. In particular, the duo noted how Michael Corleone's conversation with Kay Adams comes full circle. With this in mind, Coogler and Shawver settled on the Oakland ending with T'Challa and Shuri speaking to a boy who shares plenty of similarities with a young Killmonger.

RELATED: Doctor Doom Should Be the Villain of Black Panther 2

"Basically, him showing them that, and buying those buildings, and the Wakandan Outreach Program was in spirit what originally we had Killmonger tell him," revealed Shawver. "'If people can just see this. If people can see their own potential then things would be different.' And so that was done in a new scene where we see what T'Challa has done. And then at the very, very, very end, the last line is that kid looking at him and saying, 'Who are you?' And that is the theme of the movie, of identity. Who are you? And he doesn't need to answer it, because he just answered it for us."

Chadwick Boseman will reprise his role as T'Challa/Black Panther in Avengers: Endgame, which arrives on April 26. Directed by Joe and Anthony Russo, the film also stars Robert Downey Jr., Josh Brolin, Mark Ruffalo, Tom Hiddleston, Chris Evans, Chris Hemsworth, Jeremy Renner, Chris Pratt, Elizabeth Olsen, Sebastian Stan, Benedict Cumberbatch, Paul Bettany, Samuel L. Jackson, Cobie Smulders, Benedict Wong, Zoe Saldana, Karen Gillan, Vin Diesel, Dave Bautista, Pom Klementieff, Scarlett Johansson, Tom Holland and Anthony Mackie.