President Barack Obama offered a warm welcome to more than 30 new citizens, including an Iraqi refugee, at a naturalization ceremony in Washington, D.C. on Tuesday.

He also rebuffed calls to close American borders in light of recent terror attacks, declaring it would be un-American for the nation to close its doors to those fleeing war.

"In the Syrian seeking refuge today, we should see the Jewish refugee of World War II," Obama said at the National Archives in his speech, after 31 new citizens made a pledge to the Oath of Allegiance to the United States, the New York Times reported.

"Immigration is our origin story," he said before the new U.S. citizens at the ceremony. Altogether, the people participating in the ceremony represent 25 different countries, including Brazil, Bulgaria, Canada, Germany, Ireland and Honduras. Lorella Praeli, a prominent Latina activist and staffer for Hillary Clinton's presidential campaign, also received citizenship at the ceremony. She was born in Peru.

"You may come from teeming cities or rural villages. You don't look alike. You don't worship the same way," Obama told the group as they held tiny American flags. "But here, surrounded by the very documents whose values bind us together as one people, you've raised your hand and sworn a sacred oath. I'm proud to be among the first to greet you as my fellow Americans."

During his speech, Obama continued to counter xenophobic sentiment against Muslims and immigrants being fueled by Republicans like Donald Trump, who called for a ban on Muslims from the country and the deportation of undocumented residents.

"We must resolve to always speak out against hatred and bigoty in all of its forms," he said. "Whether taunts against the child of an immigrant farmworker or threats against a Muslim shopkeeper. We are Americans. Standing up for each other is what the values enshrined in the documents in this room compels us to do. Especially when it's hard, especially when it's not convenient. That's when it counts. That's when it matters."

According to Obama, those opposed to admitting refugees into the nation are reacting to fear in wake of the deadly terror attacks in Paris and San Bernadino, California.

He went on to recall immigrants and refugees who were shunned by the U.S. government throughout history, including Catholics, Chinese immigrants and Japanese-Americans who were put in internment camps during World War II.

"We succumbed to fear. We betrayed these documents. It's happened before. And the biggest irony is that those who betrayed these values were themselves the children of immigrants," said the president.

"How quickly we forget. One generation passes, two generations, and suddenly we don't remember where we came from."