President Donald Trump’s first tweet of 2018 wasn’t about his crowd sizes, Hillary Clinton, or the Russia investigation. It was, instead, about an issue that he’s paid scant attention to in public for his first year in office: the US relationship with Pakistan.

“The United States has foolishly given Pakistan more than 33 billion dollars in aid over the last 15 years, and they have given us nothing but lies & deceit,” Trump tweeted on January 1. “They give safe haven to the terrorists we hunt in Afghanistan, with little help. No more!”

It quickly became clear that Trump’s tweet was more than an idle threat. On Thursday the State Department announced that the US was freezing most military aid to Pakistan. The administration has declined to specify the exact amount of funds it will cut off, but the suspension could freeze up to $1.3 billion in aid.

The move has infuriated Pakistan. Foreign Minister Khawaja Asif told the Wall Street Journal on Friday that the US had turned Islamabad into a “whipping boy” to distract from its own failures in the war in Afghanistan. He also implied that the US’s move could end up torching cooperation between the US and Pakistan on issues like sharing intelligence. “We do not have any alliance” with the US, he said. “This is not how allies behave.”

Trump’s decision to freeze huge amounts of aid to Pakistan is driven by a grievance that was also held by the Obama administration — that Pakistan is aiding powerful anti-US militant groups in Afghanistan.

What makes this tricky for the US is that Pakistan could choose to retaliate by doing things like cutting off intelligence sharing and blocking the US from using supply routes that are crucial for its ability to conduct its military operations in Afghanistan.

The US has influence over Pakistan with its aid, but Pakistan is so crucial to the US’s foreign policy initiatives in the region that it too has plenty of leverage. In other words, if the US pushes too hard, it could backfire.

American aid to Pakistan has long been plagued by mistrust

US aid to Pakistan has been a point of tension and controversy for both countries for decades.

During the Cold War, the US showered Pakistan with money so it would help drive Soviet Union troops out of Afghanistan in the 1980s. Under President Ronald Reagan, the US provided Pakistan with $2 billion in military aid and $3 billion in economic assistance for development. The US worked with Pakistan (in particular, its military and its powerful intelligence agency, known as the Inter-Services Intelligence or ISI) to fuel an anti-Soviet Islamist insurgency in Afghanistan. The plan worked — and the Soviets pulled out in 1989.

Just one year later, the US cut off military aid to Pakistan. On the surface, it was because the US was putting heavy sanctions on Pakistan to punish it for its rapidly advancing nuclear weapons program.

But the US had known about that program for many years prior. Experts and diplomats say Islamabad believed aid was really being cut off because the US had achieved their goal of driving the Soviets out of Afghanistan. Pakistan found the timing particularly galling: Afghanistan was sliding into a civil war in the wake of the Soviet withdrawal, which put Pakistan in a vulnerable position.

“Pakistan had gone from being an ally to being the most sanctioned of adversaries, with a hot war right on their border,” Ryan Crocker, a former ambassador to Pakistan during the George W. Bush administration, told me.

Pakistan felt abandoned, and that informs its skepticism toward the purpose and longevity of US aid today.

After 9/11, the US wanted Pakistan’s help again to fight the war on terror

Fast forward to the 2001 invasion of Afghanistan. The US sought to topple the Taliban, which had given shelter to Osama bin Laden and al-Qaeda while they plotted the 9/11 attacks. All of a sudden, Pakistan was a crucial ally again, and billions of dollars of US aid with few strings attached started to flow into the country.

Pakistan was deeply important for the US-led war in Afghanistan. Pakistan had built strong ties with the Taliban in the ‘90s after they triumphed in the Afghan civil war, and the group took refuge in its mountainous and largely lawless Western frontier region. And the US needed routes through Pakistan to supply its war efforts.

So the US wanted Pakistan to help it fight against the Taliban. But there’s one problem: Pakistan doesn’t really want the Taliban to be defeated.

The main reason is that Pakistan doesn’t consider the Taliban — or the Haqqani network, its aggressive offshoot, which the US also sees as an enemy — to be adversaries; rather, the Pakistani security establishment views them as useful proxies to try to ensure that Afghanistan takes on a pro-Pakistan posture, especially when the war ends.

Pakistan’s leaders also fear potential blowback. If the Pakistani government takes real action against the Taliban and Haqqani network, they could end up turning their guns on the Pakistani government instead of just focusing on Afghanistan.

As a result, Pakistan essentially plays a double game with Washington: taking billions of dollars in US aid money to help fight the “war on terror,” while covertly providing safe havens for the Taliban within Pakistan’s borders. Vanda Felbab-Brown, an Afghanistan expert at the Brookings Institution, told me the ISI has at times even shared intelligence and provided material support to the Taliban and Haqqani network.

The US is aware of this double game, and isn’t happy about it. The Obama administration froze or canceled part of its promised aid to Pakistan on various occasions for this reason, like when it suspended $800 million in aid in 2011 and withheld $350 million in military aid in 2016. But so far, this tactic hasn’t worked, and Pakistan continues to enable the Taliban and Haqqani Network.

The US has a lot to lose if Pakistan decides to cut off its assistance

The Trump administration is not only freezing aid to Pakistan; it’s also threatening additional actions to pressure it to change its policies toward the Taliban and the Haqqani network. Analysts say those actions could take many forms, including expanding drone strikes against militant groups in Pakistan, imposing sanctions on Pakistani officials accused of having ties to terrorist networks, and designating Pakistan a state sponsor of terror.

But it’s going to be very difficult to persuade Pakistan to change its behavior.

That’s because Washington still benefits a lot from the partnership between the two countries, and Pakistan knows it. Ahsan Butt, a professor of international relations focusing on security in South Asia at George Mason University, told me that that Pakistan has helped the US enormously in its fight against al-Qaeda (with the major exception of tracking down Osama bin Laden). The US military also uses Pakistani military bases to launch drone strikes against militants.

And the US benefits a great deal from being able to use Pakistani roads and airspace for delivering war supplies to landlocked Afghanistan. The other best point of entry is Iran, which is unlikely to give the US the same kind of access anytime soon.

Experts say that if Pakistan shuts off this access, the alternative would likely involve using Central Asian countries north of Afghanistan and more aircraft to deliver supplies, which is far more expensive. “The alternative routes for US supplies into Afghanistan cost seven to eight times more,” Mosharraf Zaidi, a former adviser to Pakistan’s foreign minister from 2011 to 2013, told me.

If Pakistan decides to retaliate, some or all of these benefits could go away. Pakistan could stop sharing intelligence on terrorist groups with the US. It could seal off its bases. It could shut down supply routes, as it did in 2011 after the US attacked a Pakistani border post, killing 25 Pakistani soldiers, (They reopened supply routes after the US apologized in 2013.)

Pakistan could also end up embracing the US’s rivals, China and Russia, to compensate for Washington’s rejection.

“Russia has been licking its lips at the prospects of avenging the Soviet defeat to US-backed Mujahideen in Afghanistan, and Putin is from a generation of KGB officers that has not forgotten that humiliation,” Zaidi said.

And while China has already grown very close to Pakistan in recent years with its massive investment in Pakistani infrastructure, Zaidi says that “deepening that relationship would possibly permanently move Pakistan out of the US orbit of influence.”

So while the US might be the one providing the aid, Pakistan has plenty of arrows in its quiver in this standoff.