(CNN) When Peter MacDonald, Fleming Begaye and Thomas Begay joined the elite fraternity of Navajo Code Talkers during World War II, they had no idea what they were getting into.

That was by design. The top-secret program they joined wouldn't even be declassified until more than two decades later -- long after the secret Navajo code language had played a vital role in the American war effort.

All they knew at the time was that the Marines were recruiting and needed help from the Navajo people. "So we all volunteered. That's how he went in, that's how he went in, that's how I went in," said MacDonald, now 90, of his two comrades. MacDonald, Begaye and Begay were at the White House on Monday to receive praise for their service.

The three were among the Navajo troopswho learned a secret, unbreakable code language that was used to send information on tactics, troop movements and orders over the radio and telephone.

The code was indecipherable to the enemy and a key factor in the American military victories at Iwo Jima, Saipan, and several other major battles in the Pacific theater.

Only 13 of the code talkers are still alive, MacDonald said.

In the 24 hours since President Donald Trump honored them, the focus of media attention has been on his comment derisively calling Sen. Elizabeth Warren "Pocahontas." But before that comment, Trump spoke in awe about a topic he admitted he had known little about beforehand.

"I have to say, I said to Gen. (John) Kelly ... I said, 'How good were these code talkers? What was it?' He said, 'Sir, you have no idea. You have no idea how great they were -- what they've done for this country, and the strength and the bravery and the love that they had for the country,'" Trump said, turning to the code talkers, "and that you have for the country."

The origins of the Code Talkers

President Donald Trump speaks during a meeting with Navajo Code Talkers Fleming Begaye Sr., seated left, Thomas Begay, second from left, and Peter MacDonald, second from right, in the Oval Office of the White House on Nov. 27.

The three men all put their lives at risk and acted as code talkers during major battles in the Pacific.

MacDonald, the president of the surviving members of the group, fought with the Marines in Guam and in Northern China, he said.

Begaye, 97, survived the Battle of Tarawa when his landing craft was blown up and he had to swim to the beach to survive, MacDonald said.

Begaye also landed at the Pacific island of Tinian, was badly wounded and spent a year in a Naval hospital, MacDonald said.

Begay was a code talker on Iwo Jima and later enlisted in the US Army and served in the Korean War, MacDonald said.

The plan to use the Navajo language as a secret code began with Philip Johnston, who had spent his childhood on a Navajo reservation while his parents served as missionaries, according to the CIA

The idea to use a Native American language as a code was not new. The US military had used the Choctaw language during World War I as part of its secret code, but Germany and Japan had worked to learn Choctaw and other Native American languages during the interwar period, the CIA said.

But the Navajo language's syntax and linguistics are particularly tricky for non-Navajo, and it is not written. So the Marines recruited and trained 29 Navajos at Camp Elliott near San Diego beginning in 1942.

Those 29 Navajo created more than 200 new Navajo words for military terms and committed them to memory.

"I studied on my own at night," Joe Hosteen Kellwood, one of the code talkers, said of his training . "You had to memorize all the words at the time, 211 words. They were long words. I spelled it. I learned."

In simulated battles, the Navajo code proved much faster than the encrypting machines being used at the time. So in August 1942, 15 code talkers -- just over half the recruits -- joined the Marines for combat duty amid the assault on Guadalcanal.

After that first battle, Maj. Gen. Alexander Vandegrift, commander of the 1st Marine Division, sent word back to the US asking for more Navajos, according to MacDonald.

"This Navajo code is terrific," Vandegrift said, according to MacDonald. "'The enemy never understood it,' he said. 'We don't understand it either, but it works. Send us some more Navajos.'"

More than 350 people had learned the code by the end of the war. None of the original 29 code talkers who invented the language are still alive. Chester Nez, the last surviving member of the original 29, died in 2014

How it was used

Private First Class Preston Toledo and Private First Class Frank Toledo, cousins and full-blood Navajo Indians, relay orders over a field radio in their native tongue, Ballarat, July 7, 1943.

In almost every major battle in the Pacific during World War II, the US military set up two communication networks. One was in English, and it was used for most basic messages. But the other, in the Navajo code, was used for all top secret and confidential messages.

The code talkers worked in teams of two in the heat of battle, and might be working for 24 hours straight in small holes dug into the earth.

"When bombs dropped, generally we code talkers couldn't just curl up in a shelter," Chester Nez wrote in his book "Code Talker."

"We were almost always needed to transmit information, to ask for supplies and ammunition, and to communicate strategies. And after each transmission, to avoid Japanese fire, we had to move."

At Iwo Jima, the code talkers passed over 800 error-free messages in a 48-hour period, according to the Congressional law honoring the program

"Were it not for the Navajos," said Maj. Howard Connor, the signal officer of the Navajos, "the Marines would never have taken Iwo Jima."

Gen. Kelly said the Navajo Code Talkers provided "one of the very few factors" that led to success in Iwo Jima.

"We lost 6,000 Marines and 25,000 wounded on that island in 28 days of battle. It would have been a lot worse had we not had the Navajo Code Talkers," he said.

The program wasn't declassified by the military until 1968, and it would take several more decades before the story received wider recognition. In 2001, President George W. Bush presented the 29 original Navajo Code Talkers with the Congressional Gold Medal.

The story was even the focus of the 2002 action movie "Windtalkers" starring Nicolas Cage and Adam Beach.

Plans for a museum

MacDonald said at the White House ceremony on Monday that his final mission is to build a National Navajo Code Talker museum to teach the next generation about their remarkable story.

"What we did truly represents who we are as Americans. America we know is composed of a diverse community. We have different languages, different skills, different talents and different religion," he said. "But when our way of life is threatened, freedom and liberty that we all cherish, we come together as one. And when we come together as one, we are invincible."

President Trump said he would help in the effort to build the Navajo Code Talkers Museum.

"So they're working on building a Navajo Code Talkers Museum. And we will help you. Okay? We have some pretty good strength. We will help you, and you deserve it," he said.

CORRECTION: This story has been updated to give the correct spelling for Peter MacDonald.