TAUNTON, Mass. (WPRI) — Taunton Mayor Thomas Hoye is stepping down to take a job as the Bristol County Register of Probate, but state Democrats are crying foul over the timing.

Massachusetts Gov. Charlie Baker announced Hoye’s appointment just one day before the deadline to file papers to run for mayor. State Rep. Shaunna O’Connell, a member of Baker’s Republican Party, quickly announced she would run to succeed Hoye.

“I’ve had a wonderful run,” Hoye told Eyewitness News Tuesday. “I’ve loved this job. I love the work we have done for the city but it’s time for me to enter the next phase of my life.”

Shortly after the announcement, the Massachusetts Democratic Party tweeted a statement questioning the timing of the appointment, calling it “un-democratic and the kind of tactic preferred by dictators.”

Hoye said the timing was out of his control.

“I had every intention of running for re-election had this opportunity not presented itself,” Hoye said. “To quote Bill Belichick, it is what it is at this point.”

When asked about the timing, O’Connell said she had been considering a run for mayor long before Hoye’s announcement.

“A lot of people knew that something was happening with the current mayor and that he may be leaving and I think a lot of people were getting ready and thinking about running,” she said. “I have been thinking about it for the whole year and this was an excellent opportunity to get into this race.”

The appointment needs to get approval by the Governor’s Council. If it does, Hoye says he will likely resign as mayor in October.

The deadline to file was at 5 p.m. According to the city clerk, four people have submitted nomination papers: Shaunna O’Connell, Peter Bzdula, Estele Borges and Mark Baptiste.

The winner of the November election will serve a two-year term.

“The switcheroo appeared to catch everyone except those involved by surprise,” noted CommonWealth Magazine editor Bruce Mohl.

“Mayor Hoye has a strong record of serving the Commonwealth and his community, particularly children and vulnerable populations,” Baker said in a press release. “From his time teaching in the Taunton Public Schools, to his work tackling the opioid epidemic, he has dedicated his career to bettering the lives of those around him.”

Hoye, a Democrat, has served as Taunton mayor for eight years.

“I am grateful to Governor Baker and Lt. Governor Polito for their faith in me and for this opportunity to serve,” Hoye said in a press release. “I am excited to be able to continue to work on behalf of the families of Bristol County. This is the work that has made the last eight years of mayor of the city of Taunton so gratifying.”