President Trump met with Pakistani Prime Minister Imran Khan on Monday as the two nations work to mend relations that have been strained since the United States cut off $300 million in military aid to Pakistan amid complaints the country isn't doing enough to combat terrorism.

Trump and Khan traded barbs via Twitter after Khan won Pakistan’s general election just over a year ago, but during a brief appearance before a round of meetings on Monday at the White House, the two world leaders put on smiling faces and spoke about working together.

“I’ve been looking forward to this since I assumed office,” Khan said.

TRUMP MOCKS 'STAGED' GREETING FOR ILHAN OMAR, ACCUSED MEDIA OF 'SICK PARTNERSHIP' WITH SQUAD

Trump on Monday said that in the past Pakistan had not “respected the U.S.” and that the country “could have done more,” but added he was hopeful relations would improve under Khan.

The two leaders planned to discuss trade, energy, counterterrorism and efforts to bring stability to South Asia. The U.S. has been in talks with the Taliban in neighboring Afghanistan about a withdrawal of American troops from the country and an end to the 18-year-long conflict.

“I have plans on Afghanistan,” Trump said ahead of the meeting. “If I wanted to win, it would be wiped off the face of the earth. I don't want to do that.”

The Trump administration wants Pakistan to use its leverage and influence with the Taliban to achieve a cease-fire in Afghanistan, advance the peace process and create stability so he can end or substantially reduce America's involvement in the war.

"This is the longest war the U.S. has ever fought,” Khan said. “There was always going to be a political settlement at the end.”

In November, Trump slammed Pakistan in a tweet, reminding Pakistani leaders that the country had harbored Usama bin Laden before he was ultimately hunted down and killed by U.S. forces. Khan shot back in a tweet to "put the record straight" on which country had paid more in the war on terrorism.

Tensions between Washington and Islamabad eased slightly last week when Pakistani officials arrested a radical cleric and U.S.-wanted terror suspect implicated in the 2008 Mumbai terror attacks.

Hafiz Saeed was taken into custody in Punjab province while traveling from the eastern city of Lahore to the city of Gujranwala, according to counterterrorism official Mohammad Shafiq.

Saeed founded the Lashkar-e-Taiba group, which was blamed for the Mumbai attacks that killed 166 people. His charity organizations, Jamaat-ud-Dawa and Falah-e-Insaniat, are alleged fronts for Lashkar-e-Taiba.

CLICK HERE TO GET THE FOX NEWS APP

The United States has offered a $10 million reward for Saeed's arrest and Washington recently stepped up pressure on Islamabad to crack down on terror groups. In response, Pakistan registered over a dozen cases against Saeed and several of his associates, accusing them of funding militant groups through charities and leading to last Wednesday's arrest.

"After a ten year search, the so-called 'mastermind' of the Mumbai Terror attacks has been arrested in Pakistan," Trump tweeted Wednesday. "Great pressure has been exerted over the last two years to find him!"

Like many aspects of the relationship between the U.S. and Pakistan, Saeed’s arrest was complicated as officials in the country allowed him to live openly in Lahore for years and even to give interviews to foreign media.

The Associated Press contributed to this report.