The home secretary, Theresa May, has promised to look into the cases of people entitled to live in Britain who have been wrongly told to leave the country by a private company acting on behalf of the UK Border Agency (UKBA).

Capita, which won a £40m UKBA contract to trace 174,000 migrants living illegally in the country from September, has been sending text messages and emails to them telling they are required to leave Britain. But immigration lawyers say those who have received Capita's texts in recent weeks include a woman with a valid British passport and a man with a valid visa who had invested £1m in a UK-based business.

The standard text message from the firm reads: "Message from the UK Border Agency: You are required to leave the UK as you no longer have the right to remain." It urges recipients to contact UKBA immediately.

Lawyers say the texts were sent out over the Christmas period and those who were wrongly informed they needed to leave the country were left extremely distressed and upset.

Alison Harvey, of the Immigration Law Practitioners' Association, said it had asked for the messages not to be sent over the holiday period: "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."

Capita said it was working on the basis of information received from UKBA.

"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," the company said.

"Capita has been instructed to contact individuals 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."

UKBA admitted the problem was with the accuracy of its records: "We advise anyone contacted in error to contact us so records can be updated. 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."

The Liberal Democrat home affairs spokesman, Julian Huppert, pressed May at Home Office questions in the Commons on Monday to halt the practice.

May told him she would look into any individual cases for which he could provide details.

The £40m contract covers the 174,000 migrants who have been refused permission to stay in Britain but whose whereabouts are unknown to the authorities. The existence of this "migration refusal pool" was disclosed last July during an investigation by John Vine, the independent inspector of immigration. UKBA said at the time that 40% of those in the "pool" had not been formally told that they must leave Britain. Many may have already left voluntarily.