WASHINGTON — President Trump said on Tuesday that he was “never a fan” of the late Senator John McCain, “and I never will be.”

The president’s blunt remarks came in response to a reporter’s question about his recent attacks on the Republican war hero who represented Arizona, and who died last year of brain cancer.

On Tuesday, the focus of Mr. Trump’s ire was Mr. McCain’s historic vote on health care in 2017, when he went against his own party and opposed a Republican measure to repeal the Affordable Care Act.

“He campaigned on repealing and replacing Obamacare for years, and then he got to a vote and he said thumbs down,” Mr. Trump said on Tuesday after taking reporters’ questions alongside the president of Brazil, who was at the White House for an official visit. “Our country would have saved a trillion dollars and we would have had great health care.”