If there are two things MSNBC host Chris Matthews is known for, they’re his love for President Barack Obama and his knack for assuming that everyone who disagrees with him is a racist. It’s a bit shocking, therefore, to hear him tell Obama to lay off the racial politics not once, but twice.

Matthews was on “Andrea Mitchell Reports” Wednesday discussing his most recent book on the relationship between Ronald Reagan and former Speaker of the House Tip O’Neill. Matthews pointed out that when the country faced serious problems during the Reagan presidency, both parties were able to sit down and compromise. He wondered why no one could do that on issues like illegal immigration.

“Why don’t the Democrats say that? Why doesn’t the president say, instead of pandering to the Hispanic vote and liberals, why doesn’t he just say ‘You know what, I’m willing to strike a compromise. We need to get tough on illegal immigrants?’”

Matthews made a similar point when Mitchell asked whether or not Obama could rescue the final two years of his presidency. “The fact is, this president has the opportunity to put it together,” he said. “But he needs to stop playing politics, stop running for office, stop playing the ethnic groups, and say, ‘Look, I’ve only got two years left. I have to get something done.’”

Follow Alex Griswold on Twitter