A group of soldiers who served in Iraq and Afghanistan are taking legal action against the Home Office and the Ministry of Defence over an alleged systemic failure to assist them with complex, unaffordable immigration rules on discharge, leaving them classified as illegal immigrants, facing unemployment and homelessness and fearing deportation.

In the unprecedented group action taken against the two government departments, the group of Commonwealth-born veterans, each of whom served between seven and 12 years in the British army, say immigration difficulties have left them feeling betrayed by the country they served. Military charities say hundreds more are similarly affected.

MoD rules state that Commonwealth-born service personnel are eligible for indefinite leave to remain in the UK after discharge if they have served four years. But the claimants state that the army failed to inform them that they needed to make an immediate application to the Home Office for leave to remain in the UK on discharge, despite a clear MoD requirement that the process should be explained to all non-British veterans in the period before they leave the army.

Most assumed that after four years of service, the immigration process was automatic; the Home Office stamped their passports on joining the military with a note stating that they were exempt from immigration restrictions, and that they were “not subject to any condition or limitation on the period of permitted stay in the UK”. The stamps were not marked with an expiry date but nevertheless became invalid on discharge; veterans say they were not informed.

When they discovered, with the tightening of the Home Office’s “hostile environment” regulations after 2012, that they were in breach of immigration rules, they struggled to adapt themselves, mainly because of the cost of regularising their situation. Home Office visa application fees have risen sharply from £1,051 in 2015 to the current fee of £2,389. This means a service leaver and their partner with two children would have to pay nearly £10,000 to continue to live in the UK, an unaffordable sum for most on army pensions.

As a result of immigration problems, some lost their jobs, while others chose to live semi-clandestine lives, avoiding contact with the authorities, afraid that an immigration application could be rejected and they could be detained and removed from the UK. One family was visited at home by immigration officers. Some have been too scared to seek medical help, in case the NHS refers them to immigration enforcement. Others have chosen to return to their country of birth rather than risking detention, despite having the legal right to remain.

Their concerns have been exacerbated by the well-publicised 2013 case of Filimone Lacanivalu, who was arrested and detained when he tried to rectify his immigration status after discharge despite nine years of service, including two tours of Afghanistan. His situation was only resolved when the then home secretary, Theresa May, intervened 48 hours before his scheduled deportation to Fiji.

The current action involves eight former soldiers, who were all recruited to the army from Fiji, but the lawyers believe hundreds of ex-service personnel are similarly affected. The armed forces employ about 4,500 Commonwealth citizens; recruitment in Commonwealth countries has recently been stepped up “to build on the long-held links Britain’s military has with Commonwealth countries”, according to the MoD.

This Fijian soldier served in the armed forces for more than seven years but is now experiencing immigration problems. The picture has been pixellated to preserve the individual’s identity Photograph: Christopher Thomond/for the Guardian

“I gave the British army nearly 13 years of my life and I fought in war-torn zones. We were given reason to expect that we could remain indefinitely after four years of service,” said one of the claimants, who are not being named. “The careless way in which HM Forces treated me and many foreign national soldiers is very unfair and completely without any regard to the service we have given to this country.”

His immigration uncertainty has left him feeling fearful for years. “This has been an undignified existence that is so contrary to the immense pride with which I once served Queen and country.”

Another claimant who served in Northern Ireland, Iraq and Afghanistan, where he nearly died, worked for National Rail on discharge, until he was told that immigration checks were going to made be on all staff and realised his papers were not in order. Afraid of detention and deportation, he left the company and has been doing occasional cash-in-hand jobs as he attempts to resolve his situation. “I served Her Majesty’s armed forces for nine years and suffered the psychological impact of my experiences to this day. I feel that the least the army could have done is to have briefed me about what I needed to do to apply to remain in the UK after being discharged,” he said.

This sense of betrayal was echoed by a third claimant, who said: “It is so unfair for veterans to have to suffer the indignity of being vulnerable to being forcibly removed from the country that we so loyally served, especially when we are in this situation because of oversights on the part of army during the discharge process.”

An outline of proposed litigation has been delivered to the government, alleging that both departments failed to follow their own guidance and duties at discharge, with instances of incorrect immigration advice being given to the soldiers. Departing Commonwealth soldiers were given “very little guidance on the steps required” to obtain legal immigration status in Britain, it says. Moreover, “the extortionate and unaffordable costs of the Home Office fees have prolonged the state of limbo that our clients and other veterans have endured”, the summary states.

Vinita Templeton, the lawyer bringing the action on behalf of eight men, who has been working on this issue for eight years, said: “I have seen unimaginable suffering by servicemen. Their state of limbo since learning that their immigration status is actually unresolved, sometimes years later, has brought about loss of jobs, fear of accessing public services, and for some, homelessness.”

Anthony Metzer QC, who is working with Templeton, said: “Our clients have been severely let down by the MoD and the Home Office”. Lawyers want the government to acknowledge that the alleged failings occurred and grant the veterans indefinite leave to remain for free.

A government spokesperson said there would be no comment on ongoing legal proceedings, but added: “The Ministry of Defence make clear to foreign and Commonwealth recruits into the forces the process by which they and their families can attain settlement in the UK, and the costs involved.

“The government highly values the service of all members of the armed forces, including Commonwealth nationals. We are committed to upholding our obligations under the armed forces covenant, to ensure that no one who is serving, or who has served, or their family members are disadvantaged as a result of their service.”