House Speaker Paul Ryan put himself in a tough spot politically on Tuesday when he said Donald Trump’s statements about a federal judge were the “textbook definition of a racist comment” but added he would still vote for the presumptive GOP nominee.

Ryan vehemently disavowed Trump’s remarks that a judge with Mexican heritage would have a conflict of interest in deciding a case involving Trump University.

“Claiming a person can't do their job because of their race is sort of like the textbook definition of a racist comment,” Ryan said. “I think that should be absolutely disavowed. It's absolutely unacceptable.”

Ryan stopped short of calling Trump a racist, saying, “I don't know what's in his heart, but I think that comment itself is defined that way. So I am not going to defend these kinds of comments because they're indefensible.”

Trump said last week that Judge Gonzalo Curiel, who was born in Indiana after his parents emigrated from Mexico, had an “absolute conflict” in presiding over fraud lawsuits against now-defunct Trump University. The comments drew widespread condemnation from Republican officials, though the majority of them still back Trump as the GOP candidate for president.

And Ryan is one of those officials.

He didn’t back away from his endorsement Tuesday, saying he still thought Trump represented a better choice than presumptive Democratic nominee Hillary Clinton.

“Do I believe that Hillary Clinton is the answer? No, I do not,” Ryan said at a press conference announcing a new policy agenda to fight poverty. “Do I believe that Hillary Clinton is going to be the answer to solving these problems? I do not. I believe that we have more common ground on the policy issues of the day and we have more likelihood of getting our policies enacted with him than we do with her.”

Ryan said Trump’s comments on Curiel “undermine” the speaker’s efforts to craft a policy agenda for Republicans, and that he would continue to speak out against things he didn’t believe represented his party’s ideals. Ryan declined to answer whether he thought Trump needed changes in his campaign or staff, saying he’s focused on his own policy priorities.

“I think our likelihood of getting these ideas into law are far more likely if we are unified as a party, and so I see it as my job as speaker of the House to help keep our party unified,” the Wisconsin Republican said. “I think if we go into the fall as a divided party, we are … are doomed to lose, and that is why I'm going to be focusing on these ideas, these solutions and not attempt to try and defend the indefensible.”

Democrats were quick to jump on the speaker’s remarks.

“Paul Ryan continues to endorse someone who spews racist rhetoric -- the ‘textbook definition’ of a coward more concerned with partisan politics than the good of the country,” said Meredith Kelly of the Democratic Congressional Campaign Committee.