The prime minister's office said multiple sniper shots had been fired at the prime minister's car and television pictures showed two bullet marks a couple of inches apart on the cracked bullet-proof window.
Some reports suggested Gilani's son, Moosa, and Qamar Zaman Kaira, the federal minister for Kashmir and Northern affairs, were in the motorcade at the time, travelling to the airport to pick up the prime minister.
Officials said a formal investigation into the incident had been launched.
In the past, suspected al-Qaeda fighters have launched attacks on Pervez Musharraf - who stepped down as Pakistan's president last month - attacks the former president only narrowly survived.
Kamal Hyder, Al Jazeera's correspondent, who was at the scene of the assassination attempt, said questions would be asked about the lack of security.
"The question is how the sniper was able to conceal himself and how he was able to make his escape," he said.
"Reports suggest the sniper perched himself on a hilltop on the Islamabad highway from where he would have had a considerable vantage point on the convoy."
Sherry Rehman, Pakistan's federal information minister, denied the incident occurred owing to lapses in security.
Mike Hanna, Al Jazeera's correspondent in Islamabad, said the prime minister was returning from a meeting in Lahore yesterday and was due to travel to his residence after arriving at Islamabad's airport.
"This was a highly-skilled sniping attempt, given the vehicles were moving at high speed," he said.
Gilani's Pakistan People's Party leader, Asif Ali Zardari, is standing for president in elections scheduled for September 6.