It was the first visit by a top member of President Donald Trump's administration to the terrorist-hit South Asian country, and came after a stop in neighbouring Afghanistan where he suggested Washington may take a stronger line on Islamabad, for years seen as an unreliable US ally.
A statement issued by Prime Minister Nawaz Sharif's office said Mr McMaster had 'assured the Prime Minister that the new administration was committed to strengthening bilateral relations and working with Pakistan, to achieve peace and stability in Afghanistan and in the wider South Asian region.'
Mr McMaster's visits are being closely watched for clues as to the Trump administration's future course of action in the region.
US-led NATO troops have been at war in Afghanistan since 2001, after the ousting of the Taliban regime for refusing to hand over Osama bin Laden following the 9/11 attacks in the United States.
The US has around 8,400 troops in the country with about another 5,000 from NATO allies, as efforts to negotiate a lasting peace settlement between Kabul and the Taliban have repeatedly fallen through.
Afghanistan routinely accuses Pakistan of providing safe haven to the Afghan Taliban.
"As all of us have hoped for many many years, we have hoped that Pakistani leaders will understand that it is in their interest to go after these groups less selectively than they have in the past and the best way to pursue their interest in Afghanistan and elsewhere is through diplomacy not through the use of proxies that engage in violence," Mr McMaster said in an interview with Afghanistan's Tolo News Sunday.
The Pakistani statement added that Mr McMaster's delegation included Lisa Curtis, who US media have previously reported as his pick as senior director for South and Central Asia.
Ms Curtis, a well known conversative expert, recently co-authored a paper calling on the US to stop treating Pakistan as an ally and instead "focus on diplomatically isolating" it if it continues to support groups that have links to international terror.
On Thursday the US military in Afghanistan dropped its GBU-43/B Massive Ordnance Air Blast, dubbed the "Mother of All Bombs" in combat for the first time on ISIS hideouts, killing up to 95 terrorists.
The attack triggered global shock waves, with some condemning the use of Afghanistan as what they called a testing ground for the weapon, and against a terrorist group that is not considered as big a threat as the resurgent Taliban.