The United States Department of Defense paid the National Football League more than $5 million in taxpayer money between 2011 to 2014 to honor U.S. soldiers and veterans at games, an investigation revealed this week.

Nearly $5.4 million was given to 14 NFL teams across the country, the bulk of which ($5.3 million) was supplied by the National Guard and the rest paid by the Army and Air Force, according to government records obtained by NJ.com.

But instead of purely heartfelt salutes to soldiers from hometown football teams, the halftime segments were reportedly part of paid promotions under federal advertising contracts for the military.

Earlier this week, U.S. Sen. Jeff Flake (R-Ariz.) called out the spending as an “egregious and unnecessary waste of taxpayer dollars.”

“Those of us go to sporting events and see them honoring the heroes; you get a good feeling in your heart,” Sen. Flake told NJ.com. “Then to find out they’re doing it because they’re compensated for it, it leaves you underwhelmed. It seems a little unseemly.”

In New Jersey, the Defense Department and the New Jersey Army National Guard paid the New York Jets a total of $377,000 during the four-year period, according to the federal contracts.

The team’s agreement included money for a Hometown Heroes segment to salute soldiers on the stadium’s Jumbotron at the team’s home games and also tickets for the soldiers and their friends in box seats.

The investigation revealed the Atlanta Falcons collected just over a million dollars, the most cash for any team, and the Green Bay Packers received the single largest payment of $400,000.

“They realize the public believes they’re doing it as a public service or a sense of patriotism,” Sen. Flake said. “It leaves a bad taste in your mouth.”

The rest of the teams paid by the federal government were the Baltimore Ravens, Buffalo Bills, Cincinnati Bengals, Cleveland Browns, Dallas Cowboys, Indianapolis Colts, Kansas City Chiefs, Miami Dolphins, Minnesota Vikings, Pittsburgh Steelers and St. Louis Rams.

See a a full list of NFL teams that have received taxpayer money from the military for similar arrangements.

The National Guard has defended the advertisements, saying they are an effective recruitment tool for the service.

“Promoting and increasing the public’s understanding and appreciation of military service in the New Jersey Army National Guard increases the propensity for service in our ranks and garners public support for our Hometown Team,” Patrick Daugherty, a spokesman for the Guard said.