On June 6, 1944, a soldier named Bill Millin played the bagpipes to boost morale as Allied troops stormed beaches in Normandy, France, on D-Day to liberate Nazi-occupied France.

His commander ordered him to wade on the Normandy shores and play Scottish classics, even though England had banned bagpipers.

Millin, who was dubbed the "Mad Piper," later found out the Nazis did not shoot at him because they thought he was crazy.

Visit INSIDER's homepage for more stories.

On June 6, 1944, a Canadian soldier named Bill Millin became known as the "Mad Piper" when he serenaded the Allies' D-Day invasion of Nazi-occupied France with his bagpipes.

England's War Office had officially banned bagpipers from the war's front lines, saying they would attract enemy fire.

But Millin got a pass because of his Scottish heritage.

His commander, Lord Lovat, told Millin, according to The Independent: "Ah, but that's the English War Office, Millin."

"You and I are both Scottish, so that doesn't apply," Lovat said.

Lovat then had Millin play Scottish classics like "Hielan' Laddie" in waist-high water to boost morale as the Allies charged on five Normandy beaches in the largest naval, air, and land operation in history.

Read more: 75 years since D-Day: Here's how the Allies began to reclaim Europe from the Nazis

A photo of the D-Day landings in Normandy, France, on June 6, 1944. AP Images

D-Day would change the course of World War II, but fighting and raids on that day alone cost the lives of some 4,400 Allied troops, the BBC reported. Thousands of French civilians died, and 4,000 to 9,000 German troops are believed to have died, the BBC said.

Millin saw many of his comrades' bodies floating on the shore as he played his bagpipes to drown out the gunfire, he told The Independent in a previous interview.

Lovat "said I was to play and he would worry about the consequences later," Millin said.

As he waded up and down the shore, the piper was armed with nothing but his instrument and a kilt. He recalled later talking to German soldiers who said he was spared because they thought he was crazy.

"I didn't notice I was being shot at," he said, according to The New York Times. "When you're young, you do things you wouldn't dream of doing when you're older."

Read more: Photos of D-Day 75-year memorials show WWII jeeps, fighter planes, and parachuting veterans in Normandy

The Bill Millin Memorial on Sword Beach in Colleville-Montgomery, near Caen, France. Matt Cardy/Getty Images

Millin said he felt bad seeing his injured comrades, though they cheered when they saw him. One of the commandos, Tom Duncan, told The Times he would never forget the sound of Millin's pipes.

"As well as the pride we felt, it reminded us of home, and why we were fighting there for our lives and those of our loved ones," Duncan said.

After the war, Millin played the bagpipes with a traveling theater company, and he eventually trained to become a psychiatric nurse in the UK, The Times reported.

His D-Day contribution was immortalized in the 1962 film "The Longest Day."

He died in 2010 at the age of 88 in Devon, England.