Officials said that it was a suicide attack and at least 54 people, including women, children and security personnel, had been killed and 200 had sustained injuries.
"A large number of people were returning after watching Rangers flag ceremony at Wagah border when a suicide bomber blew himself up near one of the exit gates," Inspector General Police of Punjab Police Mushtaq Sukhera said. He said three Pakistani Rangers were also among the dead.
To a question about security arrangements, Sukhera said, "The Rangers had made stringent security measures but it was difficult to check suicide bomber".
Al-Qaeda affiliated militant group Jandullah, which was behind a suicide bombing that killed at least 78 Christians at a church in Peshawar September last year, has claimed responsibility for the attack.
The spokesman of the splinter group of the Tehreek-i-Taliban Pakistan (TTP) Ahmed Marwat said the attack was a reaction to military operation Zarb-i-Azb and Waziristan operation.
Huge crowds gather every evening at the Wagah crossing, 22 kilometres from Lahore, to watch a "lowering of the flags" ceremony and witness the energetic display of military pageantry that accompanies the formal closing of the border post which soldiers from both countries have conducted for decades.
Earlier reports had said it could be a cylinder blast.
In the wake of Muharram, the police had made strict security measures.
"We had reports that some banned outfits might target Shias, religious personalities, public processions and important buildings," Sukhera said.
He said, "Our teams have confirmed that it was a suicide blast". The IG said that the suicide bomber was stopped at the gate of the parade ground at the border and detonated the bomb right when people gathered near the gate.
"Up to five kilogrammes of explosive material was used in the blast," Sukhera said.
"The bomb exploded outside a restaurant near a Pakistani paramilitary soldiers' checkpoint at Wagah border," he added.
"People were returning after watching the parade at Wagah border when the blast took place. Ball bearings were found at the scene," another police official said.
Imdad Husain, an eyewitness, told reporters that he was returning after watching the parade ceremony when he heard a bang near the Wagah border market.
"I fell unconscious. When I gained consciousness there had been complete darkness. Many injured and I cried for help lying on the road. After 15 minutes some rescue men came towards me and shifted me to the Ghurki Hospital, a border area health facility," he said.
Samina Bibi was also returning along with her husband and two young children when the blast took place. On the bed of the Ghurki Hospital she was crying and asking the doctors about her husband and children. "The doctors were comforting her saying they are alright," Imdad said.
Emergency has been declared at all hospitals in Lahore.
Punjab Emergency Services Rescue 1122 spokesman Jam Sajjad told PTI that 50 people had been killed so far and feared rise in the death toll.
"We have shifted about 200 injured in different hospitals of Lahore," he said. Quoting a senior doctor at Ghurki Hospital, he said the condition of over a dozen is critical.
Prime Minister Nawaz Sharif has condemned the Lahore blast and ordered the authorities concerned to provide best medical facilities to the injured.
Pakistan has been hit by a homegrown Taliban insurgency that has left thousands of people dead in the past decade.
In June, the army began an operation against militant hideouts in the North Waziristan tribal region, after a bloody attack on Karachi airport ended fledgling peace talks between the government and the Pakistani Taliban.
The military says over 1,100 militants and 100 soldiers have been killed since the start of Operation Zarb-e-Azb while more than 100 militants have surrendered.