One of the biggest battles between Congress and the Pentagon over the past year has been over a snub-nosed grunt of an airplane, a jet so ugly (and fierce) it’s nicknamed the “Warthog.” It is beloved by the troops, particularly those who have been saved when the A-10 Thunderbolt II, and its huge 30 mm cannon, swooped in to save them in combat.

But despite the aircraft’s revered status, the Air Force has said it has no choice but to retire the fleet at a time of budget constraints. The A-10, officials have said, is designed for a single purpose—taking out enemy ground troops at such close range—a mission that could be taken over by the F-35 Joint Strike Fighter, the Pentagon’s $400 billion next-generation fighter jet.

Critics have argued that while the F-35 may be great at many things, it won’t be able to fulfill the dangerous role of what’s known as “close-air support” (or CAS) nearly as well as the A-10, which flies so low and slow it’s equipped with a titanium bathtub belly that’s designed to absorb the inevitable ground fire it receives.

A-10s from the 422d Test and Evaluation Squadron fire guns and rockets on the Nevada Test and Training Range on Aug. 15, 2013. (U.S. Air Force)

But now, after months of debate over which aircraft is better suited for CAS, the Pentagon’s chief weapons tester confirmed on Thursday that his office plans to pit the A-10 against the F-35 in a series of comparison evaluations starting in 2018.

The testing “will reveal how well the F-35 performs and whether there are gaps or improvements in capabilities compared to the A-10,” J. Michael Gilmore, the director of the Pentagon’s Operational Test and Evaluation Office, said in an interview with reporters at the Pentagon.

“You can’t guess at what the capability gaps are,” he said. “It’s really not wise to guess. You have to go out and get data and do a thorough and rigorous evaluation.”

With its sleek lines, next-generation stealth and high-tech gadgetry, the F-35, the most expensive weapons program in the history of the Pentagon, is in many ways the antithesis of the homely A-10, which has been flying for nearly 40 years.

But getting rid of the A-10 would save the Pentagon $4.2 billion, Air Force officials have said. And they said they remain committed to providing support from the air at especially close ranges to those troops on the ground.

“Delivering fires to troops engaged in close proximity to the enemy is a contact sport and we are committed to the F-35 as a critical component of this joint and combined team,” Gen. Mark A. Welsh III, the Air Force’s Chief of Staff.

The United States Air Force Weapons School at Nellis Air Force Base, Nev., receives its first F-35A Lightning II in January 2015. (U.S. Air Force)

A band of powerful—and vocal— members of Congress has been pushing back on the Air Force’s attempts to retire the plane for more than a year. Led by Sens. Kelly Ayotte (R-N.H.) and John McCain (R-Ariz), the chairman of the Armed Services Committee, these lawmakers have said the A-10 is a vital part of the Pentagon’s arsenal and that getting rid of it could endanger lives.

In a statement to The Post Thursday, Ayotte said the country has “an obligation to provide our ground troops the best possible close air support, and I will not support the divestment of the A-10 until an equally or more capable close air support aircraft achieves full operational capability.”

Designed to take out Russian tanks during the Cold War, the Warthog earned its reputation as a pugnacious brawler during the 1991 Persian Gulf War when it took out much of Iraq’s tanks artillery and missile sites. It also was called into action in Iraq and Afghanistan, where many troops equated the staccato sound of its gunfire with salvation.

Gilmore said that since the F-35 is supposed to “replace the A-10 across the board” his office has long planned to evaluate how the planes compare at performing CAS. “This is not something that has just popped up” in light of the controversy, Gilmore said.

“Comparison testing is nothing new,” he said, adding that the Pentagon did comparison tests with the F-22 and other weapons systems.

And he said it would also test the F-35 against other aircraft as well, likely including the F/A-18, which the F-35 would also replace.

If the testing reveals a deficiency in the F-35’s ability to support troops at close range, the Air Force “will utilize all of the resources we have to be able to meet that CAS requirement if we find out that the F-35 is unable to do that at that point,” said Lt. Gen. Arnold W. Bunch, Jr., the Air Force’s Deputy Assistant Secretary for Acquisition.

Because the testing comes as the plane nears what is called its “initial operating capability” for the Air Force, there is still time to develop further capability before it reaches “full operational capability,” he said.

Earlier this week, Welsh said it would be a “silly exercise” to compare the A-10 and F-35’s ability to provide CAS. In a statement Thursday, he backed away from that comment, saying he did not understand that the testing would be part of a formal Pentagon test and evaluation program.

He said he supported such testing, which “is the only way to ensure a new weapon system meets the requirements we established.”