President Donald Trump made a joke about his nickname for Sen. Elizabeth Warren (D-Mass.), “Pocahontas,” during an event honoring Native Americans Monday at the White House.

Trump was recognizing Native American Code Talkers who served during World War II when he made the remark about Warren.

″You were here long before any of us were here,” Trump told Code Talkers during the event. “Although we have a representative in Congress who they say was here a long time ago. They call her Pocahontas.”

Here's the video: Trump calls Elizabeth Warren 'Pocahontas' while honoring Native American code talkers: "You were here long before any of us were here. Although we have a representative in Congress who they say was here a long time ago. They call her Pocahontas." pic.twitter.com/hjZ5MInDDf — Kyle Griffin (@kylegriffin1) November 27, 2017

Native American Code Talkers were largely Navajo Marines who transmitted commands over the radio to soldiers overseas in their native language during World War II, after both sides became more adept at decoding encrypted messages. Native American code became more reliable than Morse code in the war, notably aiding U.S. efforts in the Battle of Iwo Jima.

Trump made his comments Monday while standing in front of a portrait of Andrew Jackson, the former president who signed the Indian Removal Act of 1830 that resulted in the tragic Trail of Tears. Thousands of Native Americans died of cold, starvation and disease during the harrowing trek to the undeveloped Western territories.

Warren responded on MSNBC shortly after Trump made the comments.

“This was supposed to be an event to honor heroes, people who put it all on the line for our country, and people who because of their incredible work saved the lives of countless Americans and our allies,” Warren told host Ali Veshi.

“It is deeply unfortunate that the president of the United States cannot even make it through a ceremony honoring these heroes without having to throw out a racial slur, but Donald Trump does this over and over thinking somehow he’s going to shut me up with it,” Warren continued. “It hasn’t worked in the past. It is not going to work in the future.”

The National Congress of American Indians asked Trump on Monday “to refrain from using her name in a way that denigrates her legacy.”

Trump has used Pocahontas’ name to refer to Warren on multiple occasions, including in a tweet earlier this month.

WATCH: Elizabeth Warren responds to Trump's "Pocahontas" remark on @MSNBC:



"It is deeply unfortunate that the President of the United States cannot even make it through a ceremony honoring these heroes without having to throw out a racial slur." pic.twitter.com/au1QntxDzR — NBC News (@NBCNews) November 27, 2017

Ed Markey, the junior senator from Massachusetts, also referred to the remarks as a slur. Markey tweeted a statement Monday in defense of Warren just after Trump made his joke.

“What @realDonaldTrump said about my partner @SenWarren is a slur,” the Democrat wrote. “It disparages the Native American war heroes, standing right beside the President, who risked their lives to protect his right to make such a disgusting comment.”

White House press secretary Sarah Huckabee Sanders addressed the president’s comment during a press briefing Monday. Sanders said Warren’s condemnation of the “Pocahontas” comment as a racial slur was a “ridiculous response.”

“I think what most people find offensive is Senator Warren lying about her heritage to advance her career,” Sanders told reporters.

Trump began using the term for the senator because during Warren’s 2012 Senate race she made unverified claims that she had Native American heritage

Former Marine Michael Smith, whose father, Samuel “Jesse” Smith Sr., was a WWII code talker, said he was disappointed by the president’s remarks during a rare White House recognition of the Navajo veterans. Smith’s father served in the 4th Marine Division and fought in the battles of Roi-Namur, Saipan, Tinian and Iwo Jima.

Smith, who watched video of the ceremony, told HuffPost that he felt the event began on a positive note but that it had been eclipsed by the incident. Before Trump’s speech, Peter MacDonald, president of the Navajo Code Talkers Association, recognized the importance of the group during WWII and called for a national museum to honor the code talkers.

“Isn’t that unfortunate that the legacy of these men can’t be paramount over the statement ― a derogatory statement, I felt ― that Mr. Trump made about a senator,” Smith told HuffPost.

Appearances by the code talkers are rare due to their age and an association bylaw that asks code talkers to disassociate themselves from politics, Smith says.

“I thought the whole press conference was going well up to that point. And it’s unfortunate that he’s so focused on attacking this person [rather] than honoring these men,” Smith told HuffPost.

Jefferson Keel, president of The National Congress of American Indians, agreed with Smith, responding in a statement Monday:

We regret that the President’s use of the name Pocahontas as a slur to insult a political adversary is overshadowing the true purpose of today’s White House ceremony,” stated NCAI President Jefferson Keel, a decorated U.S. Army officer and Vietnam War combat veteran. “Today was about recognizing the remarkable courage and invaluable contributions of our Native code talkers. That’s who we honor today and everyday ― the three code talkers present at the White House representing the 10 other elderly living code talkers who were unable to join them, and the hundreds of other code talkers from the Cherokee, Choctaw, Comanche, Lakota, Meskwaki, Mohawk, Navajo, Tlingit, and other tribes who served during World Wars I and II. We also honor the service and bravery of all of our veterans and those currently serving from Indian Country. Native people serve in the Armed Forces at a higher rate than any other group in the country, and have served in every war in this nation’s history. And we honor the contributions of Pocahontas, a hero to her people, the Pamunkey Indian Tribe in Virginia, who reached across uncertain boundaries and brought people together. Once again, we call upon the President to refrain from using her name in a way that denigrates her legacy.

This story has been updated with a response from The National Congress of American Indians.