Obama tweeted, "What truly makes our country great is its diversity. I’ve seen that beauty in so many ways over the years. Whether we are born here or seek refuge here, there’s a place for us all. We must remember it’s not my America or your America. It’s our America."
The comments appear to be in reference to Donald Trumps's recent attacks on "The Squad" -- a group of new congresswomen, including Reps. Alexandria Ocasio-Cortez, D-N.Y., Ilhan Omar, D-Minn., Rashida Tlaib, D-Mich., and Ayanna Pressley, D-Mass. Trump has particularly singled out Omar, who along with Tlaib are the first Muslim women to serve in Congress, in recent days.
The crowd at a Trump rally on Wednesday night chanted "send her back" when he brought up Omar -- a reference to a tweet attacking the four congresswomen he had sent the previous day.
Obama praised the country's diversity and said there was a place for everybody. Omar was born in Somalia, but immigrated to the U.S. with her parents as a child.
Trump condemned the chant on Thursday, but defended the crowd as "incredible patriots" on Friday.
The president was asked Friday afternoon as he left for New Jersey for the weekend if he thought the chant was "racist."
"No," Trump said.
"You know what's racist to me? When someone goes out and says the horrible things about our country, the people of our country, that are anti-Semitic, that hate everybody, that speak with scorn and hate, that to me is really a dangerous thing," he said, in an apparent reference to Omar or Tlaib.
Omar apologized earlier this year after she tweeted, "It's all about the Benjamins, baby," in reference to Republican politicians not criticizing Israel due to them taking money from pro-Israel organizations. Trump called the comments "anti-Semitic" for their reference to Jews and money, and said Omar should resign at the time.
Tlaib, who is a Palestinian-America, has also drawn criticism from right-wing politicians for criticism of Israel over its treatment of Palestine.
Trump's initial tweet said the four congresswomen should "go back and help fix the totally broken and crime infested places from which they came." Besides Omar, the other three were all born and raised in the U.S.
ABC News' Kyra Phillips contributed to this report.