Barack Obama. Eduardo Munoz Alvarez/Getty Images President Barack Obama chided Rutgers University students for scuttling Condoleezza Rice's planned 2014 commencement address.

Rutgers students successfully pressured Rice to back out of her commencement address, citing the former secretary of state's involvement in the Bush administration's decision to invade Iraq.

Speaking at the university's commencement Sunday, Obama said pressuring Rice to drop the speech was "misguided."

"I don't think it's a secret that I disagree with many of the policies of Dr. Rice and the previous administration. But the notion that this community or this country would be better served by not hearing a former secretary of state or not hearing what she had to say — I believe that's misguided," Obama said. "I don't think that's how democracy works best, when we're not even willing to listen to each other."

He added:

If you disagree with somebody, bring them in and ask them tough questions. Hold their feet to the fire, make them defend their positions. ... Don't be scared to take somebody on. Don't feel like you got to shut your ears off because you're too fragile and somebody might offend your sensibilities. Go at them if they're not making any sense.

In recent years, commencement speeches have occasionally become flash points for campus activism.

World leaders like Rice and Christine Lagarde, the managing director of the International Monetary Fund, backed out of speeches in 2014. And this year, former Secretary of State Madeleine Albright faced protests from students and some professors at Scripps College.

The president has repeatedly noted the commencement-speaker-focused activism, warning students against stifling dissenting opinions.

During a commencement address at Howard University earlier this month, Obama recalled how engaging with law enforcement in Illinois helped him pass a piece of anti-racial profiling legislation.

"When I was a state senator, I helped pass Illinois’s first racial profiling law, and one of the first laws in the nation requiring the videotaping of confessions in capital cases," Obama said. "I didn’t say to them, 'Oh, you guys are so racist, you need to do something.' I understood, as many of you do, that the overwhelming majority of police officers are good, and honest, and courageous, and fair, and love the communities they serve."