In the weeks after Freddie Gray died in 2015, the two men now running in the Democratic primary for sheriff both had roles to play.

Sheriff John W. Anderson deployed his deputies to the streets, where they helped guard City Hall and patrol areas hit by rioting. When prosecutors brought charges against six officers in Gray’s death, it was one of Anderson’s top deputies who signed the charging papers.

Anderson — who has been sheriff for three decades — said he was duty bound to help.

But challenger Stanley Brandford, the senior city police official who led the Baltimore Police Department’s Freddie Gray task force, says the sheriff’s office shouldn’t have been involved in the case.

“The sheriff did not have the skill set or the experience to do a death investigation, so I thought it ill-advised,” Brandford said.

The two men are facing off in the June 26 Democratic primary election. The winner will face Republican David Anthony Wiggins in November.

Brandford says he will make sure the sheriff’s office attains the necessary skills for major investigations by setting up a specialized unit.

Anderson said his office already has the necessary expertise because he’s recruited retired police officers who’ve worked on investigations ranging from drug dealing to murder.

The primary responsibility of the Baltimore City Sheriff’s Office is to serve the courts. Deputies protect the downtown Circuit Court buildings, secure and transport prisoners between jail and court, and serve crucial legal paperwork such as eviction notices and orders to appear in court.

With 103 deputies, the Baltimore sheriff’s office is far smaller than the Police Department, and occupies a much smaller place in the public debate about how to fight crime.

Brandford, who took a leave of absence as the Police Department’s chief of criminal investigations to campaign, wants to change that role. He says the office needs to be more visible in the community, and do more to help fight violent crime.

“The greatest trick Sheriff Anderson has ever performed is to convince the public he doesn’t exist,” Brandford said.

Anderson, who has been sheriff since 1989, said he has been working to increase the department’s visibility for the past seven years as the Police Department and community leaders have sought his help. His deputies go out on patrol and provide security at festivals and other public events. He said the office hasn’t sought to publicize its efforts.

“We’re not down there for the publicity,” Anderson said. “We’re not there for the glory.”

Anderson said one of his biggest achievements in recent years was launching a domestic violence unit and assuming responsibility for serving protective orders that direct abusive partners to stay away from their victims. The sheriff’s office pushed for legislation in the General Assembly to fund the unit through a fee on evictions.

“There was a need for it,” Anderson said.

The similarities in the two men’s visions for the office are mirrored in their similar career paths. Both served in the military — Brandford, 57, was a combat engineer in the Marines; Anderson, 71, served in the Air Force — before pursuing law enforcement work.

Brandford grew up in Pigtown and graduated from Southwestern High School. He turned down a college scholarship for the military, and then joined the Police Department in 1990. Brandford spent most of his career as a detective. He led the homicide unit for several years, seeing up close the suffering violent crime brings.

He was involved in the investigations into the 2014 death of McKenzie Elliott, a toddler hit by a stray bullet, and the 2015 rape and murder of Arnesha Bowers, a classmate of his daughter.

“I’ve seen a lot of homicides,” said Brandford, who lives in Northeast Baltimore’s Hamilton neighborhood. “All of them stick with you.”

The year before Brandford joined the police department, Anderson was appointed to lead the sheriff’s office. He’s won re-election ever since.

Anderson, who lives in Northeast Baltimore’s Northwood neighborhood, said he’s proud of modernizing the office while maintaining its close ties with the public — either at city courthouses or in city neighborhoods.

“I still wanted to keep that feeling in the community that we were part of the community,” Anderson said.

iduncan@baltsun.com

twitter.com/iduncan