Washington: The war in Afghanistan would end in few weeks if Pakistan denied the Taliban safe haven in its territory, a top US Senator has said.

Senator Lindsay Graham said that the US should negotiate with Pakistan instead of the Taliban to see an end to the war in Afghanistan.

"As to negotiating with the Taliban, I think we got this wrong. I think what we should do is start negotiating with Pakistan. If Pakistan denied the Taliban safe haven in Pakistan, the war in Afghanistan would end in a matter of weeks," Graham said in an interview to Fox Channel on Monday.

Washington resumed talks with the Taliban in Qatar on Saturday, three months after President Donald Trump had abruptly halted diplomatic efforts that could end America's longest war.

Trump called the year-long effort "dead" and withdrew an invitation to the insurgents to join secret talks at his US retreat at Camp David after the killing of an American soldier.

Graham also said that he wants to change the behaviour of Pakistan.

"So, I want to try to get Pakistan to change their behaviour through a free trade agreement tied to security performances, then talk to the Taliban. I want as much leverage over the Taliban as possible to end this war, Graham said.