The ending of The Flash was absolutely wild and brought back one of the most infamous Batman actors ever. Turns out, that was the third incarnation of this ending.

Warning: Spoilers ahead for The Flash

The ending of The Flash sees Barry Allen (Ezra Miller) able to help his father from getting incarcerated for the murder of his mother. Relieved, he steps outside and gets a phone call from Bruce Wayne. Bear in mind, Barry's reality's Bruce Wayne was played by Ben Affleck. When he gets stuck in the other dimension in the film, it's Michael Keaton that serves as that reality's Bruce Wayne. When Bruce tells Barry “I'm pulling up now,” he assumes it'll be Affleck.

In a shocking moment, it's George Clooney — who played the role in the infamous Batman & Robin film — who steps out of the sports car.

As it turns out, this wasn't the original plan (or Plan B) for Andy Muschietti and Co. According to The Hollywood Reporter, Clooney's return was the third ending conceived for The Flash. Originally, the plan was to have Supergirl (Sasha Calle) and Keaton's Batman show up on the courthouse steps to convey that Barry didn't quite accomplish his mission as he thought. When a new regime came in for DC, a new ending had to be created.

The second ending also took place on the courthouse steps, although this time it would have had Keaton's Batman in the scene with Henry Cavill's Superman and Gal Gadot's Wonder Woman. Perhaps this ending would have been slightly less confusing as both Cavill's Superman and Gadot's Wonder Woman were both mentioned and/or seen on-screen throughout The Flash. However, this was conceived when WB. and DC were still under the impression a third Wonder Woman film was happening. That was canceled and Gadot's final appearance in the DCU comes in The Flash.

As they say, the third time's the charm, and the third ending, featuring Clooney, was made. When James Gunn and Peter Safran were brought in, they scrapped the Cavill-Gadot scene as they didn't want to make promises they wouldn't be able to keep (both Cavill and Gadot seem to be out of the DCU). In a last-ditch effort, Warner Bros. sent Clooney and his agent a cut of the film, they both liked it, and the ending that we now see in The Flash was quickly shot. This ending was kept under wraps from press screenings until the week of June 4.

The Flash is in theaters now.