Abolishing militant hideouts in Pakistan is critical to establishing peace in neighbouring Afghanistan, President Ashraf Ghani said on Thursday before meeting U.S. President Donald Trump on the sidelines of the U.N. General Assembly.

Neither Mr. Trump nor Mr. Ghani mentioned Pakistan when they appeared publicly together after their discussion. But Mr. Ghani said Pakistan’s role is a key part of the Trump plan announced last month to end America’s longest war and eliminate a rising extremist threat in Afghanistan.

“Reduction of safe havens is absolutely necessary,” Mr. Ghani told National Public Radio in an interview broadcast on Thursday.

The Trump administration in August infuriated Pakistan by accusing it of providing extremists haven. The U.S. also has threatened to withhold military aid from Pakistan. The country repeatedly has said it has acted against Taliban insurgents and members of the Haqqani network militant group.

“I hope that this time, Pakistan will get the message loud and clear that business as usual cannot continue. It’s not in their interest. It’s not in anyone’s interest,” Mr. Ghani said.

“Pakistan has never had this type of dialogue with the U.S. and I hope that wisdom and shared national interests will prevail.”

After meeting Mr. Ghani, Mr. Trump praised efforts to drive the Taliban and extremist groups out of Afghanistan. He said joint Afghan-U.S. forces have made headway against Taliban, “hitting them hard and hitting them effectively.”

Senior officials have said Mr. Trump’s plan for Afghanistan involves sending up to 3,900 additional U.S. troops on top of the roughly 8,400 Americans now in the country.

Mr. Ghani stressed that Afghan forces are leading the fight. He said he isn’t seeking “a blank cheque” of unlimited American help.

Mr. Ghani said earlier in the week the Trump administration’s four-year objective is to bring 80% of the country back under the government’s control. The Taliban currently hold sway in nearly half of the nation.