ORONO, Maine — Johanna Haskell can trace her family’s legacy at the University of Maine back five generations to the first graduating class in 1872.

The 30-year-old cosmetologist and mother of three was one of 1,687 undergraduate and graduate students the university expected to participate in two commencement ceremonies Saturday at the Harold Alfond Sport Arena. She majored in English with a concentration in technical and professional writing.

“One of the big reasons for me to come here was this legacy,” Johanna Haskell of Bangor said shortly before the morning ceremony began.

Her great-great-grandfather, Edwin James Haskell, was one of six men in the first graduating class at the then Maine State College of Agriculture and the Mechanic Arts. His commencement was held in an Orono church, according to a university news release.

“For Edwin, attending school included working on the campus farm three hours a day, five days per week,” it said. “To gain admittance from 1868 to 1871, students had to be male, at least 15 years old and pass an exam that included arithmetic, geography, English, grammar, United States history and algebra as far as quadratic equations.”

He went on to found Haskell Silk Mills in Westbrook. Edwin Haskell also served as a university trustee.

Direct descendants who graduated in 143-year span between him and Johanna Haskell were: his son, Benjamin Edwin Haskell in 1912; his grandson, the Rev. Stanley Haskell in 1966; his great-grandson John Haskell in 1971.

Johanna Haskell’s father, John Haskell, majored in music.

“My father was in banking for many years before he went to Bangor Theological Seminary and the University of Maine,” John Haskell, 66, of Bangor said Saturday before the commencement ceremony began. “He graduated in 1966, the same year I graduated from high school.”

The Rev. Stanley Haskell retired as the chaplain on the ship operated by the Maine Seacoast Mission in Bar Harbor.

Speakers at the morning commencement on the 150th anniversary of the university’s founding urged students to look to the future but to stay connected to UMaine.

Bill Davids, the 2015 recipient of the distinguished Maine professor award and a civil engineer who is an expert on bridge technology, told graduates that they “will create the future of Maine and the future of the University of Maine.”

“I do not say these words lightly: I interact professionally with UMaine alums daily, and I am always inspired by their willingness and ability to become leaders in their communities and their professions,” Davids said Saturday. “I ask that you never forget what your education has enabled you to achieve, and that you recognize and defend the need for quality, public higher education throughout your life.”

Commencement speaker M. Peter McPherson, president of the Association of Public and Land-grant Universities, urged the graduates to live their lives in a way that honors the sentiment behind the 1862 law that created land-grant colleges.

“But being from a land-grant institution, particularly one as notable as the University of Maine, means that you have an obligation to carry that land-grant status with you and as part of you for the rest of your life,” McPherson told graduates. “It means that while having a good and rewarding job is important, so is making sure that you are constantly working toward making this a more fair, just and prosperous world. It means never relenting in the pursuit for greater knowledge that will enrich your own lives while providing you with greater ability to enrich the lives of others.”

The university awarded McPherson, who is based in Washington, D.C., an honorary doctorate degree. Dana F. Connors of Gray and president of the Maine State Chamber of Commerce, and Dennis Rezendes, a national pioneer in the hospice movement who lives in Boulder, Colorado, also were given honorary doctorates.