Massachusetts Supreme Judicial Court Justice David Lowy is stepping down to become the general counsel of the University of Massachusetts, where he received his bachelor’s degree in history 40 years ago.

The job change caps Lowy’s 26-year run as a judge, the last seven as an associate justice on the Supreme Judicial Court, the state’s highest court. He was appointed to that role in 2016 by Republican Gov. Charlie Baker.