The US today asked Pakistan to "confront" terrorism in all its forms as America's National Security Adviser held talks with the top civilian and military leadership here during an unannounced visit, the first by a top Trump administration official to this country.

"McMaster expressed appreciation for Pakistan's democratic and economic development, and stressed the need to confront terrorism in all its forms," said a US Embassy statement on McMaster's meeting with the top civilian and military leadership here.

The two sides discussed a range of bilateral and regional issues, it said.

During McMaster's call on, Sharif, while talking about Indo-Pak ties, reiterated his "firm conviction" to sustained dialogue and meaningful engagement as the only way forward to resolve all outstanding issues, including the Kashmir dispute, a Prime Minister's Office (PMO) statement here said.

Sharif welcomed President Trump's willingness to help India and Pakistan resolve their differences particularly on Kashmir and noted that this could go a long way in bringing sustainable peace, security and prosperity to the region, the statement said.

The Prime Minister reaffirmed his commitment to a peaceful neighbourhood and apprised the US NSA of the steps taken by Pakistan to reach out to both India and Afghanistan, the statement said.

Sharing his concerns over the deteriorating security situation in Afghanistan and the continuing impasse, Sharif conveyed Pakistan's readiness to work with the international community to explore ways in which the Afghan crisis can be resolved, it said.

McMaster's visit to Afghanistan and Pakistan comes just days after the US dropped the largest non-nuclear bomb targeting an Islamic State complex in Afghanistan, close to the border with Pakistan.

This was McMaster's first visit to Pakistan as the US NSA and the first formal high-level exchange between the US and Pakistan under the new Donald Trump Administration.

During his meeting with McMaster, Sharif stated that across-the-board consensus was achieved by his government to combat extremism and terrorism, the PMO statement said.

Sharif said that as a longstanding friend and a partner, Pakistan was looking forward to forging a strong and mutually beneficial partnership with the US and to working with the new administration, to promote peace and security in the region and beyond, the statement said.

In his call on with Sharif, McMaster conveyed President Trump's greetings and assured the Prime Minister that the new administration was committed to strengthening bilateral ties and working with Pakistan, to achieve peace and stability in Afghanistan and in the wider South Asian region, it said.

The visiting delegation included US Ambassador to Pakistan David Hale, Acting US Special Representative for Afghanistan and Pakistan Laurel Miller, Senior Director for South Asia Lisa Curtis and Director Pakistan in the National Security Council Jay Wise.

The meeting was also attended by Finance Minister Ishaq Dar, Aziz, Fatemi, Janjua, and other senior officials.

Earlier, McMaster also met Aziz, who gave a detailed briefing on the policies being pursued by the Pakistan government that have resulted in improved security environment and the "economic turnaround" in Pakistan, the Foreign Office here said in a statement.

The Pakistani side also shared its perspective on the "plight of Kashmiris" in India and the status of relations with New Delhi, the statement said.

Aziz reiterated Prime Minister Nawaz Sharif's vision of a peaceful neighbourhood and commitment to dialogue and engagement while also apprising the visiting US delegation of the steps taken by Pakistan to reach out to both India and Afghanistan, it said.

On terrorism, Aziz noted that "impressive gains" had been made in eliminating terrorists and Pakistan remained determined to continue this fight as part of the National Action Plan until the scourge of terrorism is completely eliminated from its soil, the Foreign Office said.

Conveying Pakistan's concerns over the deteriorating security situation in Afghanistan, Aziz reaffirmed Pakistan's commitment to working with the international community to support efforts for peace and reconciliation in the war-torn country.

He also highlighted the importance of effective border management as part of the actions required to achieve sustainable peace in the region.

On his part, McMaster thanked Aziz and acknowledged Pakistan's "sacrifices" in combating extremism and terrorism, the statement said.

The US NSA also renewed the commitment of the new Trump administration to work closely with Pakistan in strengthening mutually beneficial relations and also work towards the shared objectives of peace and stability in Afghanistan and the region.

McMaster's visit was a part of regional consultations that included a stop in Kabul yesterday.