The message was posted from Guildford Police's @GuildfordBeat Twitter account about an operation with the UK Border Agency to crack down on illegal immigrants.
Several users of Twitter criticised the post, which has now been deleted.
Surrey Police said the officer who sent the tweet had been given “words of advice”.
One Twitter user, Jack Law, tweeted in response: “Racism 1 Police 0 #WeWillCatchUpWithYou”.
Another, Sinthia Siren, wrote: “Absolutely disgraceful tweet from @GuildfordBeat regarding immigrants. Whatever were they thinking?”
In another message, she said: “Thank you for apology and removing it. Because yes, as a law-abiding, tax-paying immigrant, I found it extremely offensive.”
Guildford Police tweeted apologies to various Twitter users.
A Surrey Police spokesman said the tweet had been sent during the operation on Thursday which saw seven or eight people arrested in and around Guildford on suspicion of immigration offences.
In a statement, the force said: “Following a UK Border Agency led operation, supported by Surrey Police, the GuildfordBeat Twitter account gave an update about the incident to members of the public.
“The language used in a subsequent tweet was inappropriate, it was quickly removed and an apology issued.
“Surrey Police will not tolerate language which is derogatory or discriminatory and the officer who sent the tweet has been given words of advice.
“It is important to stress that whilst the intention was to update the public about a successful intelligence-led operation the wording used does not reflect the views and values of Surrey Police.”