The home secretary has apologised to immigrants – including to Afghan nationals who worked for the British armed forces and Gurkha soldiers – who were forced to provide DNA samples under the government’s hostile environment agenda.

People seeking to live and work in the UK on the basis of a family relationship can choose to provide DNA to prove a relationship to support an application.

But Sajid Javid told the House of Commons that in June it became apparent that the provision of DNA evidence had been made a requirement and was “not simply a request” in a number of family visa applications.

A review into the scandal published by the Home Office on Thursday found that at least 449 demands for DNA were issued, including 51 to Gurkha soldiers.

Ministers have previously revealed that 1,150 Afghan nationals, including 700 family members and parents of those employed by UK government, have been relocated to UK under a scheme targeted by the mandatory DNA testing, although the exact number subject to the tests is unknown.

Yvette Cooper, Labour chair of the home affairs select committee, said: “The revelation that the Home Office has been unlawfully requiring DNA tests in hundreds of immigration applications is deeply troubling and, coming after the Windrush crisis, suggests that something has gone very wrong in the Home Office again.”

“Today I want to take this opportunity to apologise to those who have been affected by this process,” Javid said.

Javid said he had set up a new taskforce for anyone who felt they had been wrongly required to provide DNA evidence for an immigration application. But he added he would order a broader review into Home Office processes to ensure the department was “fit for the modern world”.

“I know that the immigration system is operated by many highly committed people but we must make sure that the structures and processes they use are fit for the modern world and fit for a new immigration system which we will be bringing in after we leave the European Union.

“I will be reviewing the structures and processes more broadly, the structures and processes that we have to ensure they [are] fair and humane. I will now consider what form that review will take.”

Javid said he had issued instructions that officials must not mandatorily seek DNA evidence and would be looking to reimburse any individual who experienced financial loss as a result of the problem. He said they would also be examining whether DNA had been illegally demanded in any other area of the immigration system.

The home secretary said the issue came to light over the summer and an internal review was immediately ordered. The review had finished but there was further work to to be done to establish the scale of the problem, Javid said.

“But regardless of the numbers of the people that have been affected, one case is one too many,” he said. “I’m determined to get to the bottom of how and why in some cases people can be compelled to supply DNA evidence in the first place.”

The majority of cases identified were part of a Home Office operation called Operation Fugal, which started in April 2016, to clamp down on alleged fraud in some family and human rights immigration applications.

Almost 400 letters sent as part of the operation incorrectly stated that the applicant had to provide DNA evidence and that not providing such information without a reasonable excuse would lead to their application being refused on suitability grounds.

Javid said 83 applications were refused, including seven solely for the failure to provide DNA evidence. A further six appear to have been refused for failure to provide DNA evidence where this was not the sole reason.

In addition, the home secretary said the illegal requirement to provide DNA had been applied to Gurkha soldiers and Afghan nationals who had worked for the UK government.

In January 2015, a scheme was expanded to allow adult dependant children of Gurkhas discharged before 1997 to settle in the UK, Javid said.

Guidance was published that stated DNA evidence might be required and that applications could be refused if that evidence was not provided without reasonable excuse within four weeks.

“This published guidance was wrong and has now been updated,” Javid said, adding that there were 51 cases identified where DNA evidence was requested from applicants at their own cost.

There were four cases from the same family who had their application refused solely because they did not provide DNA evidence.

In 2013, applications from Afghan nationals formerly employed by the UK government to resettle in the UK were welcomed. But the terms of the scheme included mandatory DNA testing for family groups paid for by the UK government, Javid said.

Investigations suggest that no one making an application under this scheme has been refused because they did not take a DNA test, he said. “Nonetheless mandatory testing should not have been part of this scheme and this requirement has now been removed,” the home secretary continued.

“In particular I would like to extend my apology to the Gurkhas and Afghans that have been affected. The two schemes I’ve described were put in place to help the families of those who have served to keep our country safe. I’m sorry that demands were made of them that should never have been.”

Diane Abbott, the shadow home secretary, said: “Abuses like this don’t fall from the sky. Officials at the Home Office have been carrying out the government’s hostile environment policy, which is also what led to the Windrush scandal. People are being treated as guilty or illegal unless they can prove their innocence.

“We need a fair and robust immigration system, but the hostile environment isn’t it and the government should end it.”

Steve Valdez-Symonds, Amnesty UK’s refugee and migrant rights programme director, said: “The Home Office has once again been exposed as being a law unto itself. The home secretary needs to face up to the fact that problems in his department are systemic, chronic and deep-rooted.”