The Senate on Tuesday passed a change to President Donald Trump's tax law after it unexpectedly socked hundreds of Gold Star families this year with a "kiddie tax" of thousands of dollars.

The new tax law treated military and Veteran Affairs survivor benefits as trusts or estates, which subjects them to a tax rate as high as 37 percent.

The Gold Star Family Tax Relief Act would fix the error by treating military and VA survivor benefits as earned income, which is taxed at a much lower rate. That bill now goes to the House for consideration.

"Gold Star families have sacrificed so much for our nation, and passing this legislation to remove the exorbitant tax on surviving children's benefits is the least we can do," Sen. Doug Jones, D-Ala., said after the Gold Star Families Tax Relief Act passed the Senate with unanimous and bipartisan support.

Sen. Doug Jones, D-Ala., speaks during a news conference on healthcare on April 30, 2019 on Capitol Hill. Alex Wong / Getty Images file

The vote came as a group of Democratic and Republican senators took aim at another "unfair law" known as the Widow's Tax, which has been around since 1972 and prevents up to 65,000 military spouses whose partners died while serving our country from receiving full Department of Defense and Veteran Affairs benefits.

Before the Senate vote, Jones was joined outside the Capitol Building by Sens. Susan Collins, R-Maine, Jon Tester, D-Mont., James Risch, R-Idaho, and over a dozen surviving military spouses. Jones said 67 Democratic and Republican senators have signed on to “storm the hill” and get the Military Widow’s Tax Elimination Act passed.

“It’s really a shameful policy,” Jones said. “Essentially the problem is the federal government is trying to save a few bucks by ripping off” military families who have already given so much.

Yasin Wade’s husband, Navy Lt. Daniel Wade, was 38 when he died in 2015 of a heart attack while on an overseas deployment. She is now raising their three sons on her own.

“With Daniel gone, I am trying to be both a mom and a dad,” Wade said. “These are benefits we paid for and are entitled to. … This has been a burden to families in the military community for too long.”

“We paid the ultimate sacrifice,” she added.

Jones agreed.

“These families have given more to our country that most of us could ever imagine and we have an obligation to honor that sacrifice by caring for them,” Jones said in an earlier statement. “Unfortunately, these families are often experiencing a double-whammy of unfair treatment right now by our federal government.”

NBC News asked The Tragedy Assistance Program for Survivors (TAPS), an organization that helps grieving families cope after a warrior is killed in action, to explain the Widow's Tax and the current conundrum facing these families.

Service member beneficiaries get a lump-sum payment of $400,000 if the fallen warrior paid into the Service Members Group Life Insurance policy. This is a one-time payment.

The surviving spouse also gets $1,319 per month in Dependency and Indemnity Compensation (DIC) from the VA. This provides a flat rate payment for the death of a service member and that money is not taxed or transferable.

Service members can also pay into a Department of Defense insurance annuity called the Survivors Benefits Plan (SBP). It’s a voluntary program that allows them to make monthly contributions of up to 6.5 percent of their earnings to ensure that their surviving dependents get 55 percent of what would have been their military retirement pay.

Under current law, recipients get hit with the Widow’s Tax if they try to collect both the DIC and SBP money. That means for every dollar they get via the DIC, the lose a dollar from the SBP.

To avoid that, spouses would put the SBP in their children’s names so that money would be taxed at the parents’ rate.

But this year, with the new Trump tax code in effect, many Gold Star families who used that strategy saw their taxes jump, Task & Purpose, which covers the military, and other outlets reported.

Jones introduced his bill in February and it quickly won the support of Sen. James Inhofe, R-Okla., who is chairman of the Armed Services Committee.

Rep. Joe Wilson, R-S.C., has introduced a similar bill called the Military Surviving Spouses Equity Bill, which has also garnered widespread and bipartisan support.