MIDDLETOWN — Racism, injustice and hate must be confronted no matter how difficult the battle, poet Claudia Rankine, keynote speaker at Wesleyan University’s 185th commencement Sunday, told the estimated 4,000 people at the outdoor ceremony.

Rankine, an award-winning poet born to a working-class family in Jamaica and now teaching at Yale, quoted American author and civil rights activist Cornel West that “Justice is what love looks like in public.”

Other speakers Sunday also touched on topics of civil rights, fighting racism, challenging mistreatment of the powerless and speaking out about the country’s post-election politic talk about deporting undocumented people and viewing Islam as a danger and its worshippers to be kept out of the country.

Cristina Jimenez Moreta, executive director and co-founder of United We Dream, which trains youth to help the undocumented, told the crowd it is important to help refugees and the undocumented in “an era when racism and hate against people of color has been normalized.’

Moreta, Rankine and Jo Handelsman, a former deputy director of the Obama administration’s office of science and technology, received honorary doctorates from Wesleyan.

Handelsman told graduates their years at school gave them super powers they should use to better society and “speak truth to power.” The super powers, she explained, are the ability to reason and think, “not to fly or shoot laser beams out of your eyes.”

In his welcoming address, school President Michael S. Roth spoke of “an unnerving rise of right-wing populism” in the nation, which makes it crucial for people to fight what he called abusive government power targeting society’s most vulnerable.

Roth said Wesleyan is a place people can “explore our differences without fear.” He said students in the Class of 2017 took part in school programs to aid immigrants, prisoners, the poor, refugees and others on the margins of society.

“I’m glad I went to a school that is open and accepting,” new graduate Sequoia Hale Grettenberg said, minutes after receiving his bachelor’s in biology. The Northampton, Mass., resident said he considering a career in conservation or environmental research.

A student West African drumming ensemble led by master drummer Emmanuel Attah Poku played the processional and recessional music. Imam Sami Abdul Aziz gave the invocation. He is the school Muslim chaplain.

Before the start of the procession and the two-hour commencement, parents and friends looked for their favorite graduates in the line of 700 crimson-robed undergrads and about 200 black-robed advanced degree candidates.

Gloria Brennan of Fort Lauderdale, Fla., was one of the proud parents on the hunt with a camera to find a graduate. She snapped a picture of daughter Jessica Brennan, who soon would receive an earth sciences and environment degree.

In a week, Jessica and family will return to campus for another ceremony. She enlisted in the Marines while at Wesleyan and will return to be commissioned.

“She’ll go to Quantico for officer training and then go where they station her,” Gloria Brennan said. “We’re a military family. My father was in the Navy for 20 years.”