Nottinghamshire Police tweeted that it would be recruiting new officers. It appealed to people from minority ethnic groups and the LGBT community to apply.
It prompted anger from users and a spat with a former UKIP candidate.
The NottsPolice Equality account responded, saying they were "proud to use #PositiveAction".
More on this story and other news in Nottinghamshire
Lee Waters, who stood for UKIP in Gedling last year, tweeted that the force should "employ people on ability - regardless of colour or who they sleep with".
He agreed the force needed to better reflect the community it serves, but said: "I think adverts like that actually create division when really we should be looking at integration."
NottsPolice Equality's original tweet did receive support:
Poppy_Corbett: I think they're interested in equality and ensuring the people who protect us represent all the communities they serve
But it prompted a mostly angry response:
Katabasis: I'm a white straight British male and therefore a minority where I live. Can I apply?
Lord John Slade 52%: I'm a white English bloke, do I qualify
Andrew: when I call 999 can I specify which person I would like to attend, based on my gender/ethnic group?
Supt Ted Antill, responsible for equality on the force, said: "We are actively striving to better represent the communities we are serving.
"We know we are under-represented and that does frustrate our attempts to engage with certain communities."
He said the force wanted more applications from ethnic minorities and LGBT communities, but officers would only be appointed on merit.
Under section 158 of the Equality Act 2010, employers can take positive action to "enable or encourage" people with a "protected characteristic" (such as race, religion and sexual orientation) to overcome disadvantages associated with that characteristic.
According to the College of Police, this allows specific groups to be targeted "before or at the application stage" but not that they will be employed because of their background.
Section 159 of the act does allow someone to be employed because of their protected characteristic, but only when they are "as qualified as or of equal merit" to an individual who does not have that characteristic.
The Equality Act
A police force has strongly defended its recruitment policy after it was branded discriminatory in a row on Twitter.