The president of the five-campus University of Massachusetts system will leave to become chancellor of the University System of Maryland, the institutions announced Wednesday.

Robert Caret will start his new position on July 1. He is succeeding William Kirwan, who is stepping down after serving since 2002 as chancellor of Maryland's system, which has 12 institutions and more than 162,000 students.

Caret, 67, was named president of UMass in January 2011 after previously serving as president of Towson University - part of Maryland's network - from 2003 to 2011.

"He brings years of experience as the outstanding leader of two public universities and a public system of higher education. He is adept at building partnerships that benefit institutions and the surrounding communities," said James Shea, chairman of the Maryland system's Board of Regents.

Caret was scheduled to be introduced at a news conference in Baltimore on Friday. He said in a statement that he was "excited and energized" to return to Maryland.

Henry Thomas, chairman of the UMass Board of Trustees, expressed disappointment with Caret's decision to leave Massachusetts, but said he understood the reasons.

"We were pleased with his performance. He did an excellent job for us but he had some family issues that were driving his decision-making," said Thomas. Caret's wife spends a significant portion of her time in Maryland and he has children who live in that state.

Caret also has strong New England ties. He was born in Biddeford, Maine, and attended Suffolk University in Boston and the University of New Hampshire, where he received his doctorate in organic chemistry in 1974.

Caret, who signed a five-year contract when he was hired in Massachusetts, had recently agreed to a new contract with the university that included a clause requiring he give at least six months of notice before departing for another job, Thomas said.

Trustees must decide whether Caret should continue as president through July 1; Thomas said he would recommend that Caret stay on to provide stability while the board conducts a "first-class search" for a successor, a process likely to take several months.

The UMass system consists of the university's flagship campus in Amherst; campuses in Boston, Lowell and Dartmouth; and the University of Massachusetts Medical School in Worcester.

Caret fought successfully to increase state financial support for the university and achieve a 50-50 split between state funding and other sources of revenue, a move that allowed UMass to freeze tuition and fees in the past two academic years for in-state undergraduate students.

He promised a "smooth and successful transition," adding: "It has been a great privilege to lead UMass, a world-class university."