Screenwriter David Ayer has admitted his 2000 film U-571 distorted history and that he would not do it again.
British sailors captured the Enigma machine from a Nazi submarine
Ayer told BBC Radio 4's The Film Programme that he "did not feel good" about suggesting Americans captured the Enigma code rather than the British.
"It was a distortion... a mercenary decision to create this parallel history in order to drive the movie for an American audience," he said.
At the time, Tony Blair said the film was an "affront" to British sailors.
US screenwriter Ayer revealed his grandparents were involved in World War Two.
"Both my grandparents were officers in World War Two, and I would be personally offended if somebody distorted their achievements," he told presenter Chris Tookey.
"I met with the Royal Navy officer who actually went down into the U-boat and recovered the Enigma machine in 1941.
"He seemed OK with it, he was a great guy, but I understand how important that event is to the UK, and I won't do it again," he added.
Ayer's latest film, crime drama Harsh Times, which he has written and directed, is released on Friday.