UKIP leader Nigel Farage has dismissed claims his party backs deporting existing EU migrants amid a row over comments made by its candidate in the Rochester and Strood by-election.
Mark Reckless suggested existing EU migrants would only be allowed to remain in the UK for "a transitional period" should the UK quit the EU.
But Mr Farage insisted UKIP respected the "rule of law and British justice".
And he downplayed the comments as a "minor cause for confusion".
Mr Farage insisted the by-election, in which his party is seeking to get its second Westminster MP elected, was being fought on UKIP's terms and the issue of immigration would "dominate" next year's general election campaign.
The row was sparked when former Conservative Mr Reckless was asked - at a televised hustings broadcast by ITV's Meridian - what would happen to EU migrants already living and working in Britain if the UK chose to leave the EU in a future referendum.
He suggested they would be looked at "sympathetically" but should only be allowed to remain in the UK for "a fixed period".
Asked later on BBC Radio Kent if he was suggesting they should be deported, he said: "No I was not suggesting that."
Mr Reckless said EU citizens in the UK legally at the time the country left the EU would be able to stay in the country and accused Conservative critics of "twisting" his words.
Mr Farage told the BBC his colleague had been referring to the negotiations that would take place during a "transitional period" between a hypothetical vote to leave the EU and the actual moment of withdrawal.
"When we invoke Article 50 of the Lisbon Treaty which sets us off on a two-year negotiation to leave the EU, part of that renegotiations is what happens to retired people from Britain living on the Costa del Sol and what happens to people from Warsaw living in London," Mr Farage said.
"Let me make this clear, during our divorce negotiations, even if the EU was to behave badly and say [British] people living in Spain were to be threatened with not being there, we would maintain the line that we believe in the rule of law, we believe in British justice and we believe that anyone who has come to Britain legally has the right to remain."
Asked if Mr Reckless did not know UKIP policy, Mr Farage said the campaign had been "long and hectic" and candidates in that situation often "got into a mode" of answering "on the topic and not the specific wording of the question".
But Conservative MP Damian Green said Mr Reckless had come "dangerously close" to advocating a repatriation policy while Labour's Yvette Cooper said Mr Reckless had "let the mask slip".
She said using the "language of repatriation" was "a policy that comes straight out of the last BNP manifesto and does not reflect British values".
In a separate row on the last day of campaigning in the constituency, Mr Reckless accused the Conservative candidate Kelly Tolhurst of issuing a leaflet he described as "BNP-light" in its comments on immigration.
Ms Tolhurst told the BBC that Mr Reckless's claim was a "lie", and said she was disappointed at the misrepresentation of her views.
The paragraph of the leaflet in question reads: "Most people I know here have worked hard all their life, played by the rules and paid their fair share. But we sometimes struggle to access some of the services we need because of uncontrolled immigration. Others don't feel safe walking down the high street of our town. And those who are most vulnerable are being let down by a hospital that needs to do better."
Ms Tolhurst then begins a new paragraph outlining her six-point program focusing on issues including immigration, health, crime, housing, and jobs.
BBC political editor Nick Robinson said the controversy today stems from the fact that UKIP are now facing the same sort of scrutiny as the established Westminster parties - scrutiny "that is not always comfortable".
The Rochester and Strood by-election takes place on Thursday. Polling stations will be open from 07:00 GMT to 22:00 GMT.
The full list of candidates, in alphabetical order by surname, is:
Barker, Mike - Independent
Challis, Christopher - Independent
Davidson, Hairy Knorm - Official Monster Raving Loony Party
Fransen, Jayda - Britain First
Goldsbrough, Stephen William - Independent
Gregory, Clive - Green Party
Juby, Geoff - Liberal Democrats
Khan, Naushabah - Labour
Long, Nick - People Before Profit
Osborn, Dave - Patriotic Socialist Party
Reckless, Mark - UK Independence Party
Rose, Charlotte - Independent
Tolhurst, Kelly - Conservative