The makers of Avengers: Endgame agonised over Tony Stark's final word to Thanos in the movie's climactic final battle scene.

What they came up with was pretty much perfect – Thanos: “I am inevitable”, Tony: “And I am Iron Man”, before dealing ‘the snap’ right back at him – but it nearly wasn't.

And we mean really nearly wasn't.

Christopher Markus and Stephen McFeely, who penned the movie, mulled hurling in the first ever F-Bomb into the Marvel Cinematic Universe.

Read more: Dark Phoenix could lose £98 million

Speaking on the Empire magazine podcast, Markus said: "It was actually relatively late in the game. In some ways, it seemed juvenile, but it seems awesome."

“I think there was 'f**k you' at one point. Didn’t he say f**k off?" offered up McFeely.

“He may have said it… you do a lot of takes. Like can we really end all this on a complete swear? On a kiss my ass Thanos?” added Markus.

View photos Robert Downey Jr. as Tony Stark in the finale of Avengers: Endgame. (Disney) More

It would have been a stunning misfire had they stuck with that, particularly in comparison to what they went with, which dovetailed the whole 22 movie arc of Marvel movies impressively.

As it turns out, it wasn't even the writers – or directors the Russo brothers – who came up with the line.

It was in fact Jeff Ford, the film's editor, and a veteran of the Marvel movies.

Read more: It was RDJ’s choice to stay silent in Endgame finale

Said the Russos: “Tony used to not say anything in that moment.

“And we were in the editing room going, ‘He has to say something. This a character who has lived and died by quips.’ And we just couldn’t, we tried a million different last lines.

“Thanos was saying ‘I am inevitable.’ And our editor Jeff Ford, who’s been with us all four movies and is an amazing storyteller, said, ‘Why don’t we just go full circle with it and say I am Iron Man.’ And we’re like, ‘Get the cameras! We have to shoot this tomorrow.’”

Rather better than tossing off an F-bomb, and that's quite apart from the fact that it would have likely bumped the movie up to a different certificate.