People living legally in the UK have been incorrectly told to leave the country by a firm working for the government.
Capita were contracted by the UK Border Agency (UKBA) in September to track down 174,000 illegal immigrants.
Among those contacted by text and email were a woman with a UK passport, and a man with a valid visa who had invested £1m in a UK business.
Capita said some of the information provided by the UKBA may be inaccurate.
The Home Office, which runs the UKBA, has advised anyone contacted in error to contact them so records can be updated.
The contract could be worth up to £40m for Capita, who are one of the largest contractors working on outsourced local and national government operations.
'Distressed and upset'
Migrants are contacted by text message, telephone or email.
The standard text message reads: "Message from the UK Border Agency. You are required to leave the UK as you no longer have the right to remain." It then advises people to contact the agency.
The director of the Peterborough Racial Equality Council, MJ Ladha, was approached by a woman who had been contacted by Capita before Christmas.
Mr Ladha told the BBC the woman had been told she was an "over-stayer" and should prepare to leave the country. She holds a UK passport which is valid for 10 years.
"She was very distressed and upset, she was crying and shaking. Whoever has done this doesn't know what they are talking about," he said.
Mr Ladha said he advised his client to complain to the UKBA.
He added: "It [the system] is completely ineffective. If I am an over-stayer and I get a phone call, I'm not exactly going to pick up my bags and go."
Immigration lawyers and advisers approached the government in an attempt to have the messages stopped over the Christmas period, but their request was refused.
Alison Harvey from the Immigration Law Practitioners Association told the BBC: "We were concerned at reports of people who had valid leave to be in the UK receiving the texts and that over the holiday period it would be difficult for them to get in touch with their lawyer and they would be anxious and distressed with no possibility of reassurance. Our request was declined.
"People will no doubt assume that the texts are spam as sending texts through a sub-contractor for a matter of this gravity is not what one would expect from a government department."
Ms Harvey said that it was impossible to know the number of text messages that have been sent in error.
Among those who have been contacted were students with valid visas and a businessman who had invested £1m in a UK company, and who also lived legally in the UK, Ms Harvey added.
She added that despite some clients contacting Capita to update their records, the problem was not solved.
She said fellow lawyers had reported "clients talking to Capita to explain they have current leave, only to receive another text the next day.
"It is difficult to get clear information about what is happening," she concluded.
In a statement, Capita said: "A contact telephone number is provided for applicants to discuss their case, and any individual contacted who believes they have valid leave should make use of this number.
"Capita has been instructed to contact individuals direct regardless of their legal representation as many of the details the UK Border Agency has on file may be inaccurate and out of date given the age of the cases".
The UKBA admitted last year that it could not locate the 174,000 people from the Migration Refusal Pool, whose applications to stay in the UK had been refused.
It was also revealed that about 60% of them had never been served with documents requiring them to leave the country.
Capita was hired to trace those in the pool and warn them that they are required to leave the country. The firm will be paid depending on how many actually go back to their home country.
A UKBA spokesperson said: "Where our records show that people are here illegally, it is vital we are able to contact them as we are determined that they should return home.
"This is the first time a government has taken proactive steps to deal with this pool of cases, some of which date back to December 2008.
"We have to make sure we keep control over our immigration system and we will enforce the removal of anyone who refuses to go home voluntarily."