Gilanis' press secretary told the BBC the attack occurred in Islamabad where Gilani was returning in his bullet-proof vehicle after visiting Lahore.
The report said the prime minister had visited Lahore to drum up support for his party leader Asif Ali Zardari in the presidential election set for Saturday.
The report said television pictures showed bullets hit the windows of the driver's door, but there were no injuries.
No other details either on the shooting or about the shooter wee immediately available.
Zardari, whose Pakistan People's Party leads the ruling coalition, is the husband of former Prime Minister Benazir Bhutto, who was assassinated last December at an election rally in Rawalpindi.
Zardari's coalition has come pressure since its main partner, the Pakistani Muslim League-Nawaz, quit over the issue of the reinstatement of judges dismissed last year by former President Pervez Musharraf.
The worsening political crisis comes at a time when the country is gripped by mounting militant violence.
Ron Burgundy interviews Peyton Manning on SportsCenter
Man spent 15 hours in jail for plugging electric car into an outlet at a school