LEWISTON — U.S. Rep. John R. Lewis recalled the impact of a Bates College graduate on his own life and urged those graduating in 2016 to serve humanity.

In a speech that brought several standing ovations and thunderous applause Sunday morning, the civil rights leader and Georgia Democratic congressman called on Bates graduates to use their education as a tool to set “our little planet” free.

“Be a headlight, not a taillight,” he said.

Lewis, a civil rights leader who challenged segregation at bus terminals and lunch counters across the South in the 1950s and 1960s, was the keynote speaker at the Lewiston college’s 150th commencement. He spoke in a ringing baritone as he drew references from his own life in exhorting graduates to seek justice for all.

Lewis recalled Benjamin Mays, who graduated Phi Beta Kappa from Bates in 1920 to go on to become a preacher, civil rights activist, president of Morehouse College in Atlanta and mentor to both Martin Luther King Jr. and Lewis.

“I heard him speak about Bates College many, many times – this man, this beautiful spirit, this beautiful soul, son of slaves,” Lewis said. “It was Bates College that gave him the tools to become emancipated.”

Lewis spoke in front of 462 students receiving degrees. The college has an enrollment of about 2,000 students, 10 percent of them from Maine and 21 percent from minority groups.

Lewis thanked Bates for freeing and liberating Mays and mankind through education.

“If it hadn’t been for Dr. Mays, I am not sure there would have been a Dr. Martin Luther King Jr.,” Lewis said.

Lewis has been arrested at protests 45 times, five while serving as a House member and mostly recently in 2013 as he called on Congress to act on a comprehensive immigration bill.

His other arrests came during protests as a Freedom Rider during the civil rights movement, when he helped lead more than 600 protesters across the Edmund Pettus Bridge in Selma, Alabama, on March 7, 1965. The marchers were attacked by police in a confrontation known as “Bloody Sunday.” He is the recipient of the Presidential Medal of Freedom.

The son of sharecroppers in Troy, Alabama, Lewis recalled the segregated South. He said he started writing to King, who took him under his wing and called him “the boy from Troy” as Lewis began to “get in the way” as he fought for civil rights.

“I started to get into trouble, good trouble, necessary trouble. You must find a way to get in the way,” Lewis said.

Honorary doctorate degrees were given to Lewis; writer Lisa Genova, a Bates graduate and author of “Still Alice” and other novels; Harvard professor Daniel Gilbert, a social psychologist who explores happiness; and educator Robert Witt, a Bates graduate and retiring University of Alabama System chancellor.

Bates President A. Clayton Spencer compared this year’s graduates to Bates’ first class of eight graduates in 1867. They were all men, Spencer said, although the chronicler of that class, Frank Eugene Sleeper, recorded that seven others of the original entering class of 24 were women.

Spencer said Sleeper also reported that the average height of the class of 1867 was 5-foot-8, the average weight was 147 pounds and the average age was 25.

“All eight could sing, all eight professed to being religious and all eight confessed to drinking ‘spirituous liquors.’ So in some ways, they fit right in,” Spencer said.

Spencer noted the differences between the first class of graduates and the class of 2016, with its graduates representing 32 states, the District of Columbia and 43 countries. Graduates included 11 Fulbright scholarship winners, two Watson Fellowship recipients and two Davis Peace Project Award honorees.

“You have achieved all this while also giving back. Members of the class of 2016 have performed over 75,000 hours of community-engaged learning, research and volunteer work,” Spencer said.