WASHINGTON — Military death gratuities will be exempted from future government shutdowns under a provision included in the defense appropriations deal announced this week.

The move means a permanent fix for an infrequent but devastating problem facing grieving military families caught up in national political budget fights. In each of the last two partial government shutdowns, widows of troops killed on duty were forced to wait several days for the military’s automatic financial assistance because federal rules prohibited the payouts.

Language in the defense minibus bill, expected to be passed by the House and Senate before the end of the month, will now create an exemption for those families. Even if other military services and benefits are shuttered, the death gratuity payments will still be processed.

“This really is the very least we can do for families who have made the ultimate sacrifice,” said Rep. Gerry Connolly, D-Va., who sponsored legislation making the change. “Never again will a government shutdown cause a grieving military family to be denied a death gratuity payment during their time of mourning.”

Lawmakers have been reluctant in recent years to exempt many government services from the effects of a partial federal shutdown out of fear the moves could discourage compromise on reaching budget deals and avoiding the shutdowns altogether.

But the death gratuity issue has been a particularly offensive example for many members of Congress.

During the three-day government shutdown in January (which came as Republicans and Democrats fought over funding and immigration issues) the families of two U.S. soldiers killed in a helicopter crash had to wait several extra days for the emergency funding to arrive because Pentagon officials weren’t allowed to process the checks.

In 2013, during the 17-day shutdown over government spending issues, lawmakers had to pass emergency legislation to allow the checks to be processed after several families of troops killed overseas complained the money was not being delivered.

The death gratuity, a $100,000 tax-free payout to troops who die on active-duty and certain reserve statuses, is designed to “provide immediate cash payment to assist survivors … to meet their financial needs during the period immediately following a member's death.”

Keith Humphrey, an advocate whose son-in-law was killed in 2009 while serving in the Marine Corps, said even a delay of a few days in receiving that money can create financial and emotional problems for those military families.

“I keep playing back in my memory the day my son-in-law died and the relief I felt when our Marine Corps (casualty officer) told me the death gratuity was in place,” he said. “I couldn’t imagine those families in 2013 and this year that were not protected."

Humphrey, a Navy veteran, said the news of the rule change’s inclusion in the appropriation bill has left him “so relieved and filled with emotion.”

The spending measure — which includes $674 billion in defense appropriations along with the full fiscal 2019 budget for the Departments of Health and Human Services, Labor, and Education — must be approved by both chambers and signed by the president before Oct. 1 in order to avoid a partial government shutdown this fall.

But leaders from both parties have already backed the deal, viewing it as a political win to avoid more financial controversy ahead of the mid-term elections in November.