Hamid Karzai, the former president of Afghanistan, praised President Trump on Monday for challenging Pakistan to increase its cooperation on anti-terrorism measures.

“President @realDonaldTrump tweet on Pakistan's duplicitous position over the past 15 years is vindication that the war on terror is not in bombing Afghan villages and homes but in the sanctuaries beyond Afghanistan,” Karzai wrote in a Twitter post. “I welcome today's clarity in President Trump's remarks and propose a joint US - regional coalition to pressurize the Pakistan military establishment to bring peace to not just Afghanistan but the entire region.”

Karzai led Afghanistan from December 2001 to September 2014, coming to power with the help of the U.S. military. He has long blamed Pakistan for not doing enough to stop Taliban “safe havens” in the country. He's spoken out against the Trump administration in the past, criticizing its military strategy for the war in Afghanistan.

Trump tweeted Monday morning the U.S. would no longer be investing as much in foreign aid to Pakistan as it has under previous presidents unless the country contributes better to anti-terrorism measures in Afghanistan.

“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, thinking of our leaders as fools. They give safe haven to the terrorists we hunt in Afghanistan, with little help. No more!” Trump tweeted.

Pakistan has been a staging ground for American troops in the war in Afghanistan, and the two countries’ militaries have often worked together to apprehend terrorists along the Afghanistan-Pakistan border.

However, Pakistan has proved to be a complicated partner, as was shown when the country allegedly knew terrorist leader Osama bin Laden was hiding in the country for years before he was tracked down by American special operatives and killed in Abottabad.

Reports surfaced last week the Trump administration was considering withholding $255 million in funding over its frustrations with the Pakistani government.