Joseph Getty at a news conference regarding the legislative session in Annapolis, Md., on April 05, 2016. (Linda Davidson/The Washington Post)

Joseph M. Getty, who has served in two branches of Maryland government, joined the third branch of state government Monday when he was sworn in as a judge on Maryland’s highest court.

Getty has served as Gov. Larry Hogan’s chief legislative officer since January 2015. Prior to his appointment to Hogan’s administration, he was a Republican delegate and senator who represented Carroll and Baltimore counties, and a member of former governor Robert L. Ehrlich Jr.’s staff.

Getty will replace Judge Lynne A. Battaglia, who was appointed by Gov. Parris N. Glendening (D) in 2001 and retired in April.

“I have every confidence that Judge Getty will make an excellent addition to the bench,” Hogan said after Getty was sworn in, placing his hand on a family Bible passed down through six generations with his wife, Susie, next to him.

Hogan read a letter from Joseph Bryce, a former chief legislative officer for former governor Martin O’Malley, who said Getty “represents all that is good in a public servant.”

Senate President Thomas V. Mike Miller Jr. (D-Calvert) and House Speaker Michael E. Busch (D-Anne Arundel) lauded Hogan for appointing Getty to the Maryland Court of Appeals, each describing Getty as someone who showed integrity and character during his 20 years in Annapolis.

Getty, who Miller and Busch described as someone who served as a buffer between the far right and the far left, graduated from the University of Maryland School of Law in 1996. He served on the House Judiciary Committee and the Senate Judicial Proceedings Committee during his time in the legislature.

“It’s a bittersweet day,” Miller said during the investiture ceremony attended by top state elected officials, including Democrats Brian E. Frosh, the state attorney general, and state Treasurer Nancy Kopp; Republican legislative leaders; members of Hogan’s staff; and Getty’s family and friends.

Miller noted that it was a happy day for Getty, his family and the court, but also a sad day for the legislature.

“It’s sad because the middle has lost a very important person,” he said. “Congress is losing people in the middle and so is the legislature.”

The Senate must confirm Getty’s selection when it returns next year.