The U.S. military may have another option for disposing of $7 billion worth of armored vehicles and other equipment it’s struggling to get rid of now that its war in Afghanistan is ending.

Some of it could be driven across the border and handed over to Pakistan, part of an effort by the Pentagon to unload excess military supplies to U.S. allies at no cost.

The discussions between American and Pakistani officials have been going on for months and center on leftover military hardware that the United States does not want to pay to ship or fly home.

Although no final decisions have been made, Pakistan is particularly interested in the U.S. Army’s mine-resistant ambush-protected (MRAP) vehicles, which Pentagon officials say will have limited strategic value as U.S. forces withdraw from Afghanistan this year.

But with Pakistan’s military expected to be battling Taliban insurgents for years, the MRAPs could help Pakistani forces slow their high casualty rate of more than 20,000 dead or injured troops since 2001.

“We will not take it for the sake of just taking it, and we will not take it because it’s free,” said one senior Pakistani military official, who spoke on the condition of anonymity because he was not authorized to discuss the negotiations. “We will take it because we need it.”

About 150,000 Pakistani soldiers are along the country’s border with Afghanistan, and U.S. officials are counting on them to help keep the pressure on militant groups after 2014.

But Pakistan’s troops remain vulnerable to roadside bombs and explosive devices, and their armored vehicles can withstand far less force than a U.S.-made MRAP, officials said.

The United States had been a major weapons supplier to Pakistan for decades, but those sales slowed dramatically after the U.S. military raid that killed Osama bin Laden in Pakistan in 2011.

Over the past year, the tension has eased, and leaders in both countries have stressed that they need to work together to try to ensure regional stability after the U.S.-led coalition withdraws from Afghanistan.

Last fall, Secretary of State John F. Kerry signed a waiver authorizing U.S. weapons sales to Pakistan through at least this year.

The backbone of the U.S. military’s vehicle fleet in Afghanistan, MRAPs were designed to protect American troops from explosive devices. But each MRAP weighs as much as 40 tons, and Pentagon leaders have said it would potentially cost more than $100,000 per vehicle to ship them back to United States. They also have qualms about leaving them in Afghanistan, noting that the stock is far larger than what the Afghan army would be able to maintain.

The Washington Post reported in June that the U.S. military was shredding hundreds of MRAPs for scrap metal, despite their initial cost of $400,000 to $700,000 each.

But Mark E. Wright, a Pentagon spokesman, said the military still has about 13,000 MRAPs scattered worldwide that remain in good working condition, including about 1,600 in Afghanistan.

The U.S. government is offering them to allies for free on an “as-is, where-is” basis, Wright said. But the recipients, who would be vetted by the State Department, would be responsible for shipping them out of Afghanistan.

Twenty countries have expressed an interest, he added.

The Defense Department “is reviewing every request and is expediting the review process to support U.S. retrograde timelines,” said Wright, noting that decisions must be made by the end of this year.

But Marine Gen. Joseph F. Dunford, commander of coalition forces in Afghanistan, told the Senate Armed Services Committee on Wednesday that many countries have ultimately decided that it’s neither cost-effective nor practical for them to pay to collect the MRAPs from Afghanistan.

“It’s very expensive for countries to take those vehicles from Afghanistan,” he said.

Pakistan, however, shares a 1,500-mile border with Afghanistan. Coalition forces also use Pakistani highways and ports to ship material into and out of landlocked Afghanistan.

In January, the New York Times reported that Uzbekistan, which borders Afghanistan, also has been inquiring about receiving surplus U.S. military hardware.

At the time, the newspaper noted­ that the U.S.-led coalition was increasingly relying on Uzbekistan to transport equipment and supplies out of Afghanistan because supply routes through Pakistan were partly blocked.

Since then, however, a major Pakistani political party has lifted its blockade of NATO supply routes through the northern part of the country. Since January, there also have been several high-level meetings between U.S. and Pakistani officials over ways to bolster cooperation.

A Pakistani security official, who spoke on the condition of anonymity because he was not authorized to discuss the matter, said the military is exploring the acquisition of night-vision and communications equipment.

The official said Pakistan stepped up its efforts to find more advanced counterterrorism equipment and armor in the fall after a Pakistani army general was killed by a roadside bomb near the Afghan border. About 5,000 Pakistani troops have been killed in clashes with the Taliban or in terrorist attacks since 2001, including 114 over the past six months.

Siemon T. Wezeman, a senior researcher and South Asia expert at the Stockholm International Peace Research Institute, which tracks global weapons sales and transfers, said Pakistan also has reached out to Turkey in search of more heavily armored vehicles.

But Wezeman said a deal between the United States and Pakistan to transfer old MRAPs could benefit both countries.

Although Prime Minister Nawaz Sharif has been boosting the defense budget, Wezeman notes that Pakistan remains a cash-strapped nation. And U.S. military commanders, he said, fear leaving surplus equipment in Afghanistan because of uncertainty about the Afghan army’s ability to fend off Taliban insurgents.

“Handing them all over to the Afghan army isn’t really an option,” Wezeman said. “There is a feeling in the U.S. that the Afghan army is not totally reliable, so it may be safer to just park them in Pakistan.”

Still, U.S. officials are mindful that any significant transfer of military hardware to Pakistan could complicate relations with Afghanistan and India, another U.S. ally in the region.

Pakistan and India have fought three major wars since 1947, but Wezeman doubts that India would seriously object “to a few hundred MRAPs ending up in Pakistan.” He notes that the bulky vehicles were built to fight an insurgency and would have little value in a major cross-border war involving tanks and warplanes.

It’s less clear, however, how Afghan President Hamid Karzai and Afghan military leaders would react. Karzai, who is leaving office this year, is deeply skeptical of Pakistan and believes that the U.S.-led coalition has not done enough to prepare the Afghan army for threats from Pakistan and other countries that border Afghanistan.

Even if the United States agrees to give Pakistan military hardware from Afghanistan, Pakistani officials stress that there are limits to what they’re willing to accept.

“Pakistan won’t become America’s junkyard,” one official said.