WASHINGTON — President Trump on Monday transformed a White House ceremony to honor Navajo veterans of World War II into a racially charged controversy, using the event as a platform to deride Senator Elizabeth Warren as “Pocahontas.”

Standing in the Oval Office alongside three Navajo code talkers, whom he called “very, very special people,” Mr. Trump dispensed with his prepared remarks and took aim at Ms. Warren without naming her, resurrecting a favorite nickname as the veterans stood stonefaced.

“You were here long before any of us were here,” Mr. Trump said to the veterans, ages 90 and older, who wore their military uniforms for the occasion, juxtaposed with turquoise and silver, hallmarks of Navajo culture. “Although we have a representative in Congress who, they say, was here a long time ago. They call her Pocahontas.”

He made the remarks while standing in front of a portrait of President Andrew Jackson — a favorite of Mr. Trump’s — who served as the nation’s seventh president and signed the Indian Removal Act of 1830, which resulted in the mass displacement and deaths of Native Americans often referred to as the Trail of Tears.