Mr Trump on Tuesday called a jurist who ruled against his asylum policy an “Obama judge”.
The president’s gibe provoked a stern statement from the head of America’s highest court.
Mr Trump has defended his comments, saying Chief Justice Roberts is wrong.
It is the first time the chief justice has spoken against Mr Trump.
“We do not have Obama judges or Trump judges, Bush judges or Clinton judges,” Chief Justice Roberts told the Associated Press.
“What we have is an extraordinary group of dedicated judges doing their level best to do equal right to those appearing before them.”
Speaking on the eve of America’s Thanksgiving holiday, he said an “independent judiciary is something we should all be thankful for”.
Mr Trump responded on Twitter on Wednesday, saying the top justice was wrong and that “Obama judges… have a much different point of view than the people who are charged with the safety of our country”