Dr Rachel Frosh, who worked with Hertfordshire police and crime commissioner David Lloyd, said she could not “fully comment” on some political issues while remaining in the job.
She said: “I appreciate that David must have constructive relationships with all political parties.
“I recognise that I am not able to fully comment on some political issues whilst remaining as Deputy Police and Crime Commissioner.
“It is therefore with great regret that I have tendered my resignation this morning.”
A row was sparked when Dr Frosh retweeted the entry that said “Dear Socialists embrace your inner Nazism”, and linked to a picture of Adolf Hitler with a quote beside.
Afterwards she stressed that she was not attempting to compare any mainstream party with the Nazis.
Mr Lloyd said: “I am sad to have to accept Rachel’s resignation. She has taken the honourable course of action by making this decision and I will miss her valuable contribution to my work to further improve policing and crime reductions for the public of Hertfordshire.”