He was accompanied by federal ministers for defence, foreign affairs, finance and information and the state minister for interior.
The prime minister was received by Chief of the Army Staff (COAS) Gen Qamar Javed Bajwa and other top military commanders.
Imran Khan assures all-out support to NAB
Upon his arrival, the prime minister was presented a guard of honour. Subsequently, he laid a floral wreath at the Martyrs' Monument.
Later, the prime minister was introduced with all principal staff officers (PSOs) of the GHQ.
The footage released by the military's media wing about the prime minister's visit was significant: this was one of the rare occasions when the top brass were shown saluting the prime minister.
During the briefing at the GHQ, Imran presided over the meeting while the army chief and top commanders sat on one side of the table while federal ministers sat on the other side.
During the previous government, the prime minister and his team used to sit across the table in the GHQ.
Observers believe that the manner Imran was given a warm welcome at the GHQ and the way the entire top brass saluted him could be part of efforts by the military to show that an elected prime minister was the real boss.
Before the Inter-Service Public Relations (ISPR) issued a formal statement on this occasion, Federal Information Minister Fawad Chaudhry described the visit to the GHQ as wonderful.
"A wonderful visit to the GHQ today. PM and members of the cabinet are proud to meet the command of the world's best army. A detailed briefing in the GHQ was of great value. With close coordination and cooperation amongst all institutions, we shall overcome all challenges confronting Pakistan," he said in a tweet after the GHQ trip.
According to the ISPR's official handout, the prime minister and ministers were given detailed briefings on the security environment, threat spectrum and response.
"Updates on Pak Army's campaign against terrorism, ongoing Operation Raddul Fasaad, Karachi situation and Khushal Balochistan programme was also given," it stated.
The prime minister greatly appreciated professionalism, operational readiness, and contributions and sacrifices of Pakistan Army in the war against terrorism, the ISPR stated.
He (the prime minister) said Pakistan was facing external and internal challenges, but with the support of the nation and through a cohesive national approach, "we shall successfully overcome (all) these (challenges)", the ISPR stated.
Imran, it stated, had assured that the government would provide all resources necessary to maintain the army's capability and capacity.
Pakistan, ISPR quoted Imran Khan as saying, was "destined to rise and Inshallah, we shall rise, staying positively relevant in the comity of nations".
Later, the army chief thanked the prime minister for his visit and reposing confidence in the army.
General Bajwa assured that Pakistan Army "shall … continue to deliver on nation's expectations of defending the motherland at all costs and sacrifices".
Sources privy to the discussions said that the civilian leaders and military commanders had discussed key challenges on the external front.
They also devised a strategy for the upcoming crucial visit of US Secretary of State Mike Pompeo.
Earlier, a telephonic conversation between Prime Minister Imran Khan and the Secretary of State had led to a controversy.
However, some media reports insisted that Pakistan had decided to bury the controversy after the State department shared the transcript of that conversation with Islamabad.
PM Imran's use of helicopter does not account for VIP culture: Fawad
Speaking at a news conference, Foreign Office's spokesperson had replied that both sides had decided to move on.
"We would want the episode to end. The Foreign Minister has commented on this in detail. Politically, we need to move on," Dr Muhammad Faisal said without elaborating.
Iran FM visit
Meanwhile, Iran's Foreign Minister Javad Zarif arrived in Pakistan on a two-day visit.
This is Zarif's eighth visit to Pakistan since he was elevated to the post of foreign minister in 2013.
Soon after his arrival, Zarif was quoted by IRNA as saying: "Since the formulation of new government in Pakistan, we thought it is necessary to visit our close friend at the earliest."
During his two-day stay in Pakistan, Zarif is scheduled to meet Prime Minister Imran Khan, his counterpart Shah Mahmood Qureshi and Finance Minister Asad Umar.
He is also expected to meet Army Chief General Qamar Javed Bajwa.
COMMENTS
Comments are moderated and generally will be posted if they are on-topic and not abusive.
For more information, please see our Comments FAQ