At the height of the second world war, Robert Mendoza was one of thousands of seamen who risked their lives in a mission described by Winston Churchill as "the worst journey in the world": the delivery of vital supplies to northern Russia between 1941 and 1945.

The so-called Arctic convoys are credited with helping to tip the balance against the Nazis.

Mendoza – then still a teenager – was right in the thick of the action serving aboard HMS Wanderer and having to contend with the constant threat of attack by German U-boats and aircraft, freezing conditions, atrocious weather and food shortages. The campaign cost the lives of around 3,000 seamen and, while Mendoza was one of the lucky ones, he didn't escape unscathed. While at sea he lost three stone and developed pulmonary tuberculosis, a type of TB that affects the lungs.

Little did he realise back then, when he and his fellow sailors were dodging enemy submarines, that this bout of TB was to have a huge impact on his family's finances almost 70 years later.

After the war, Mendoza went into insurance, eventually setting up his own broking company. He died last June aged 87.

His heirs are now benefiting from a cheque from the taxman for more than £20,000 after they made use of a little-known tax break buried away in the Inheritance Tax Act. This allows for an estate to be exempt from inheritance tax if the deceased was a former member of the armed services who sustained illness or injury while serving in a war. They were able to show that Mendoza's TB was a "contributory factor" in his death.

It's an exemption very few people are aware of, and one that has probably been overlooked by the families of other ex-service people who died many years after suffering an injury, or becoming ill, while serving during a war.

But it's not just for members of the armed forces. Others who were at the sharp end, including doctors, nurses and even newspaper war correspondents, may also be eligible.

At some point prior to his death Mendoza became aware of the existence of the exemption, and was keen to ensure it was something his family explored after he died.

"He left a note with his papers, addressed to my family, saying words to the effect of: 'You must try to claim this exemption'," his grandson Nick told Guardian Money.

Nick, 33, also knew about the exemption, as you could say it's his job to know about these things – he is a solicitor specialising in administering estates, trusts and will writing, though up until now he had never had to claim it on an estate.

First, Nick and his family tracked down all his grandfather's medical records, going right back to before the war. They then wrote to the Service Personnel & Veterans Agency (SPVA), which provides pay, pension and support services to military personnel and the veterans community, and is the body that decides exemption requests.

On its website, the SPVA explains that if a serving or former member of the armed forces dies from – or their death can be shown to have been "hastened by" – an injury sustained or disease contracted on active service against the enemy "or other service of a warlike nature" (such as operations against hostile forces in peace time or anti-terrorist operations), a complete exemption from inheritance tax can be granted to their estate under the provisions of section 154 of the Inheritance Tax Act 1984.

"Each application for an exemption is considered on its merits, after the death of the veteran concerned, and requires the Ministry of Defence to be given access to the veteran's full medical records," it adds.

There is no time limit on the exemption as long as it can be established that the injury or disease was a contributory factor in the person's death.

Normally when someone dies, inheritance tax at 40% has to be paid if their estate is worth more that a certain amount: £325,000 in 2012-13. Most estates don't have to pay because they are valued at less than the threshold; however, Mendoza's estate was above it. His assets included a property in Westcliff-on-Sea, Essex, where he lived for most of his life and where his grandson also lives.

"The SPVA said we needed to send them all the medical evidence, which we did," says Nick, who works for London-based law firm HowardKennedyFsi. "What we were able to show from his medical records was that the problem he had with his lungs, which he contracted while he was on the Arctic runs and which affected him throughout his life, was one of the factors that contributed to his death. When I was a kid, he always used to get short of breath, but I never knew the reason why."

He adds: "Once the SPVA has made a decision, they issue a certificate, and you send that off to HM Revenue & Customs, and they give the exemption. Once you've got the certificate, HMRC can't refuse it." The family later received notification that the SPVA had written to the Revenue to confirm that the estate was exempt.

The family had already paid all the inheritance tax due in order to avoid interest charges (if it's not paid within six months of the end of the month in which the individual died, you start to rack up interest), but they didn't have to wait long to get the money back. A cheque soon arrived for more than £20,000.

Nick admits he thought it would be harder than it was to successfully claim the exemption: "I anticipated that we might have a bit of a battle on our hands." But in their case the medical evidence was strong. "I can see there may be cases where it would be borderline and it may be harder to get it. And there are probably a lot of cases out there where it gets overlooked. I suspect it's been missed on numerous occasions."

His advice to others where there is a family member who fought in a war and suffered an injury or illness, is that they should ensure their medical records are up to date.

Following the death, the family should contact the SPVA as soon as possible. In their case, Nick says his grandfather was receiving a war pension and was therefore assessed occasionally. "In our case it wasn't too difficult. It depends on the individual case and whether that person, or their doctor, has records going back far enough."

What if your relative died a few months or even years ago, and the full inheritance tax was paid on their estate because the family members weren't aware this exemption existed?

In theory, there is nothing in the legislation to stop a family making a retrospective claim. The challenge – particularly if the individual died many years ago – will be getting hold of their detailed medical records.

Responding to those who might question whether there should be tax exemptions of this sort, Nick says of his grandfather, who joined the navy aged 17 after lying about his age, served aboard HMS Wanderer from 1943 until 1945, and experienced horrific conditions: "He played his part in the war and suffered as a result of it. Why shouldn't he be entitled [to the exemption]?"