Harry Hamlin was put through the wringer when auditioning for "Indiana Jones."

Hamlin, 68, auditioned for the iconic role in 1978 in front of director Steven Spielberg and writer George Lucas -- without exactly knowing it.

The audition seemed normal at first, with Hamlin set to read lines with Stephanie Zimbalist, who was auditioning for the role of Marion in "Raiders of the Lost Ark."

MARVEL PRESIDENT REVEALS HOW 'HARRY POTTER' MOVIES INSPIRED HIM TO BUILD MARVEL CINEMATIC UNIVERSE

“When I got there, Steven came down,” Hamlin said to Page Six. “He said, ‘Harry, Stephanie, I’m so sorry, but George’s plane is going to be late. He’s flying down from San Francisco and it’s going to be at least 45 minutes until he gets here.'”

According to Hamlin, Speilberg, now 73, asked the actors to prepare a chocolate cake that would be ready in time for Lucas' return.

Harry Hamlin and his wife, actress Lisa Rinna in 2018.

Harry Hamlin and his wife, actress Lisa Rinna in 2018. (Photo by Rodin Eckenroth/Getty Images)

“He closed the door and left and we were standing alone in this kitchen,” continued Hamlin. “I said, ‘Stephanie, have you ever made a chocolate cake?’ And she said, ‘No … '”

The duo then spent 40 minutes attempting to bake a cake without a recipe to follow.

"It never occurred to me … that we were actually in the audition while we were making the cake,” said Hamlin.

ADAM SANDLER'S 'UNCUT GEMS' RANKS 7TH FOR MOST F-WORDS IN FILM HISTORY

Hamlin then revealed that the kitchen had been bugged with cameras and microphones so that Speilberg and Lucas, now 75, could get a better sense of the chemistry between the actors.

The "Clash of the Titans" star recalled talking with Zimbalist, 63, about his friend Amy Irving, who would eventually marry Spielberg.

“I was talking about how Amy was calling her friend group in L.A. and saying that this guy, this director guy was stalking her in New York and how she was kind of getting annoyed because this guy, Steven Spielberg, was showing up at the stage door every night with flowers,” recalled Hamlin. "I’d been riffing on how annoying Steven Spielberg was to my friend Amy, so hey, guess what? I didn’t get the part, okay."

He added: “I’ve never worked with Steven Spielberg, and I grant you that I never will work with Steven Spielberg and I never learned how to make a cake.”

CLICK HERE TO GET THE FOX NEWS APP

Hamlin and Zimbalist lost the roles to Harrison Ford and Karen Allen, respectively.