The main speaker, actor Chadwick Boseman, star of the blockbuster film "Black Panther," gives a Wakanda salute to the crowd. Picture: Bill O'Leary/The Washington Post

Washington - Actor Chadwick Boseman, star of the box office smash "Black Panther," returned to his alma mater Howard University on Saturday to urge its newest graduates to find purpose in their lives and persevere, even amid adversity.

"I don't know what your future is," said Boseman, who delivered the main address at the university's 150th commencement. "But if you're willing to take the harder way, the more complicated one, the one with more failures at first than successes . . . then you will not regret it."

Boseman, who graduated from Howard in 2000, spoke to hundreds of newly minted graduates and their loved ones, who had gathered on its iconic Yard to celebrate and consider their future.

"Purpose is the essential element of you," Boseman told the graduates. "It is the reason you are on the planet at this particular time in history. Your very existence is wrapped up in the things you are here to fulfill.

"Whatever you choose for a career path, remember the struggles along the way are only meant to shape you for your purpose," he said.

The ceremony capped off a turbulent academic year at Howard, the historic private university in Northwest Washington that is known as "the Mecca" of black education.

In September, former FBI director James Comey was jeered throughout an address at the university, bombarded by chants of "Get out, James Comey! You're not our homie!" In late March, students began an occupation of the school's administration building, a demonstration that would stretch into early April.

A brutal winter battered the campus. A scandal unfolded in the school's financial aid office. A critical email from the school's president about a worried student's "tone and tenor" caught fire on social media.

"Howard has gone through a lot of ebbs and flows," Jade Agudosi, who served as president of the Howard University Student Association this academic year, said in an interview before the ceremony. "Through the year, we've shown our resilience."

On this bright Saturday, though, there was joy on Howard's campus. And Boseman recalled his fond memories at the institution, including his own experiences with student activism.

"This is a magical place," he said. "A place where the dynamics of positive and negative seem to exist in extremes."

Boseman told the crowd of a time in his acting career when he was cast in a role but found himself conflicted about the character he was supposed to portray. He felt the role seemed to be wrapped in assumptions about the black community, and he raised the issue with executives on the show.

He said he was let go from the job soon after.

"As conflicted as I was before I lost the job, as adamant as I was about the need to speak truth to power, I found myself even more conflicted afterward," he said.

He said his Howard education had prepared him for roles that have included Jackie Robinson, Thurgood Marshall and T'Challa, the superhero's real name in "Black Panther."

"But what do you do when the principles and standards that were instilled in you here at Howard close the doors in front of you?" Boseman said. "Sometimes you need to get knocked down before you can really figure out what your fight is."

Boseman also took note of the recent student protest at Howard, which had gained national attention this spring. For eight days, Howard students occupied the administration building to force university officials to address a list of simmering grievances, from campus housing to tuition increases. They hung a banner that read "Student Power" and transformed the building into a makeshift encampment as they negotiated with university representatives.

Among their demands was the resignation of Howard's president, Wayne Frederick. But he appeared with student leaders at a news conference that marked the occupation's end, and a member of the school's Board of Trustees said he had the board's "unequivocal and unwavering support."

Boseman, who said he also took part in student protest at Howard, praised both the demonstrators and members of the administration who listened to their concerns.

"I didn't come here to take sides," he said. "My interest is what's best for the school."

As he concluded his remarks, Boseman told the graduates that their university's legacy was not wrapped up in the money its graduates will make, but rather the challenges they will choose to confront.

"Press on with pride and press on with purpose," he said. "God bless you, I love you, Howard. Howard forever."

Howard awarded more than 2,000 degrees in 2018, according to the school. Included among the graduates was Charles Anderson, who at age 73 was the oldest member of Howard's 2018 class this spring. Anderson, a father of four, earned a degree from the masters program at Howard's School of Divinity.

"I just love to study and learn," Anderson said. "I don't care how old you get, you can just learn so many different things."

Diploma recipients also included Agudosi, the outgoing student leader, who said Friday that she would be graduating with honors.

"Howard has made me a better woman," she said. "Howard has made me a better leader. Howard has made me a better friend. I'm so indebted to Howard University, and all that she's done to take this little girl from the suburbs of New Jersey and turn her into a woman that hopefully will take over the world."

Video: From Chadwick Boseman to Oprah Winfrey, noteworthy individuals are descending upon the nation's colleges to deliver commencement addresses. Here's a selection. Video: Victoria Walker,Taylor Turner/The Washington Post