"Black is beautiful, hate is ugly," the biracial artist said near the end of his set.
"To all the beautiful countries filled with culture, diversity, and thousands of years of history: You are beautiful, you are not shitholes," he said.
The comment was censored as it aired on CBS.
Logic's line was met with a standing ovation by the Grammy audience, according to a Variety reporter in the theater.
Addressing reporters in the press room later, Logic said: "I'm not a politician but if that man can call those beautiful places shitholes, I can stand up and say that they are not shitholes and that they are amazing."