Jake Gyllenhaal is shedding light on a crazy stunt in the new Michael Bay film “Ambulance,” in which he plays a career criminal driving a stolen ambulance full of hostages while being chased by police along the bank of the Los Angeles River.

While the stunt is the movie’s showstopper, Bay — who’s demonstrated his action-movie cred in such films as “Transformers”, “Bad Boys” and “Armageddon” — didn’t have that scene in the original script, and cooked it up on the spot.

“I had no idea,” Gyllenhaal revealed in an interview with Variety at the premiere of the film, explaining how he learned he was about to hang out of a moving vehicle during a high-speed car chase.

READ MORE: Jake Gyllenhaal Does A Pitch-Perfect Michael Bay Impression

“We were on our way home, [co-star] Yahya [Abdul Maheen II] was driving the ambulance. We were almost finished with our day, and we were driving to get back into our civilian clothes, out of our characters’ clothes. Michael called us on the radio and was like, ‘Wait, come back! They opened up the L.A. River!’” Gyllenhaal recalled.

Bay walked them through the stunt. “‘He was like, ‘I have an idea! I have two helicopters!’” Gyllenhaal said. “And I was like, ‘How? What are you talking about, you have two helicopters? Where are they?’”

Once Bay managed to co-ordinate the plan with his stunt team, they were off and running.

READ MORE: See Jake Gyllenhaal’s Reaction To Amy Schumer’s Oscars Joke About Him And Sister Maggie

“[Michael] just planned the whole scene, sort of an improvisation of the scene, and it went that way,” Gyllenhaal explained.

“Every day was a little like that,” he added. “And I was like, ‘That’s why you make a Michael Bay movie. That’s the reason. To hang out of a moving vehicle and have fun.’”

“Ambulance” hits theatres on Friday, April 8.