LONDON  Bill Millin, a Scottish bagpiper who played highland tunes as his fellow commandos landed on a Normandy beach on D-Day and lived to see his bravado immortalized in the 1962 film “The Longest Day,” died on Wednesday in a hospital in the western England county of Devon. He was 88.

The cause was complications from a stroke, his family said.

Mr. Millin was a 21-year-old private in Britain’s First Special Service Brigade when his unit landed on the strip of coast the Allies code-named Sword Beach, near the French city of Caen at the eastern end of the invasion front chosen by the Allies for the landings on June 6, 1944.

By one estimate, about 4,400 Allied troops died in the first 24 hours of the landings, about two-thirds of them Americans.

The young piper was approached shortly before the landings by the brigade’s commanding officer, Brig. Simon Fraser, who as the 15th Lord Lovat was the hereditary chief of the Clan Fraser and one of Scotland’s most celebrated aristocrats. Against orders from World War I that forbade playing bagpipes on the battlefield because of the high risk of attracting enemy fire, Lord Lovat, then 32, asked Private Millin to play on the beachhead to raise morale.