Fleming Begaye Sr., a Navajo code talker in World War II who was honored at a White House ceremony in 2017 that turned political when President Trump mocked Senator Elizabeth Warren’s claims of Native American ancestry, died on May 10 in Chinle, Ariz. He was 97.

His death was confirmed by his granddaughter Theodosia Ott.

Mr. Begaye and two other former code talkers, Peter MacDonald and Thomas Begay, were being honored in the Oval Office for their participation in a top-secret program in which American forces in the Pacific communicated in coded messages in the Navajo language.

The Japanese were unable to break the code, and the code talkers were credited with helping to secure the Allied victory in the Pacific.

The honorees, wearing their Marines uniforms along with turquoise and silver, hallmarks of Navajo culture, were alongside Mr. Trump when he derided Ms. Warren without mentioning her by name.