TWO YEARS AGO, days after she stepped down in late 2018 as chair of the Massachusetts Republican Party, Kirsten Hughes landed on her feet at the Norfolk County sheriff’s office.

Hughes, one of Gov. Charlie Baker’s close political allies, was given a $75,000 contract to serve as a special legal counsel, which turned into a $137,000-a-year job as a special sheriff, and ultimately led to her appointment last year by the governor as a clerk magistrate of the Stoughton District Court ($152,000 a year).

Hughes’s swift ascent via the sheriff’s office may help explain why the race for Norfolk County sheriff has been so hard fought this year. The sheriff oversees the Norfolk County Jail in Dedham and all the jobs that go with it. Republicans, who rarely get a chance at sheriff jobs, particularly in a Democratic enclave like Norfolk County, are desperate to hang on.

Democrat Michael Bellotti was the Norfolk County sheriff for 19 years until he stepped down in 2018, a third of the way through his six-year term, to head Quincy College. Baker appointed Jerry McDermott to replace him and now McDermott is running in a special election to serve out the remainder of Bellotti’s term. Another election for Norfolk County sheriff will be held in 2022.

McDermott represented Allston and Brighton on the Boston City Council for six years before moving to Westwood, where he worked a series of jobs, including state director for former US senator Scott Brown. McDermott was registered as a Democrat when he served on the Boston City Council. He unenrolled from the party in 2010, and became a Republican in 2013. In 2018, he took a job in the Baker administration as chief of staff at the state agency that oversees state buildings and by the end of the year he was Norfolk County sheriff.

With close to two years as sheriff under his belt, McDermott is now facing a challenge from another pol named McDermott. Patrick McDermott, no relation to Jerry, has been the county’s register of probate since 2003 and before that was a Quincy city councilor. From 1993 until 1995, he worked as a legislative aide to Michael Bellotti, who was a state representative at the time.

The race has received relatively little press attention, but the two candidates are waging aggressive efforts for the job. According to campaign finance records, Patrick McDermott has spent nearly $151,000 this year through the end of September, eking out a win in the Democratic primary against two opponents, and then mounting a general election challenge against Jerry McDermott.

Jerry McDermott has spent nearly $95,000 over that same time period without facing a primary challenge. During October, he received another $165,071 in direct mail support from a super PAC affiliated with Baker, with the mailings that went out highlighting McDermott’s strong ties to the governor.

“The amount of money spent in this race is a reflection of the uphill battle that Republicans face in getting elected in a heavily Democratic county,” said Andrea Cabral, who previously served as Suffolk County sheriff.

Jerry McDermott told the Patriot Ledger last year that running the jail is not a partisan job. “There’s not a Democratic way to run this place and there’s not a Republican way to run this place,” he said.

But winning the job does come down to politics, and that’s what’s will be decided with today’s election.