Virginia Gov.-elect Terry McAuliffe named Brian J. Moran on Friday to be his secretary of public safety, choosing a past political rival for a key Cabinet post.

McAuliffe announced the appointment in Arlington County, where for seven years Moran was a prosecutor in the commonwealth’s attorney’s office.

“Keeping Virginians safe is the highest priority of state government, and Brian Moran has the talent, experience and dedication to undertake that important mission as a member of my Cabinet,” McAuliffe said.

Moran, 54, said he was “honored” to accept the post and said he was “eager to get to work alongside the thousands of firefighters, state and local police officers, sheriffs and deputies, first responders and so many others who devote their lives” to keeping the commonwealth safe.

McAuliffe, who takes office Jan. 11, announced two Cabinet picks Thursday: Nancy Rodrigues as secretary of administration and Karen Jackson as secretary of technology.

McAuliffe and Moran were rivals in the governor’s race four years ago, when they lost the Democratic nomination to a third contender, Sen. R. Creigh Deeds (D-Bath). Deeds lost the general election to Robert F. McDonnell (R).

A state delegate for 12 years, Moran served on the Courts of Justice Committee, the Virginia State Crime Commission and the Secure Commonwealth Panel, formed after the Sept. 11, 2001, terrorist attacks. He is the brother of Rep. James P. Moran (D-Va.).

Most recently, Brian Moran has been a partner at New South Strategic Partners, a government relations firm. From 2009 through 2012, he was executive vice president and general counsel at the Association of Private Sector Colleges and Universities.