In scenes similar to the terrorist attack on Mumbai in November, the gunmen attacked with heavy weapons, spraying the Sri Lankan team bus with bullets as it drove to the Gaddafi stadium in Lahore.
Several players and one Briton in the convoy of vehicles were reported to have received "superficial" injuries. A Sri Lankan foreign ministry official said two players, Thilan Samaraweera and Tharanga Paranavitana, had been taken to hospital. He said three more players were slightly injured and the head coach, Australian Trevor Bayliss, sustained minor injuries.
Television footage showed glimpses of the assailants running through the streets with machine guns in their hands and rucksacks on their backs.
The attack happened in Gulberg, an upmarket area of the city, at around 9am local time. All the gunmen remain at large after retreating into a nearby commercial and shopping area.
Police cordoned off the area, saying they would kill or capture the terrorists.
Habibur Rehman, the police chief of Lahore, said there were around 12 gunmen, at least some of whom arrived in auto-rickshaws.
"Because the police were protecting them [Sri Lankan team], we were the main victims," said Rehman. "They [the gunmen] looked like trained people. The security provided was good."
The vehicle carrying the umpires Simon Taufel and Steve Davis and match official Chris Broad, the father of England bowler Stuart, was also attacked.
A rocket launcher and grenades were recovered from the scene.
The Sri Lankan cricketers, who were playing a Test match against Pakistan in the city, are to be evacuated by military helicopter from the area immediately.
"This was a planned terrorist attack. They had heavy weapons," said Salman Taseer, who heads the provincial government as the governor of Punjab. "These were the same methods and the same sort of people as hit Mumbai."
Around 170 people died in Mumbai when militants staged a three-day gun attack. Earlier this year, there was an armed attack on government buildings in central Kabul.
Today's attack is another indication that extremists may have adopted new tactics, preferring guns to the suicide bombings that had become their hallmark.
Cricket teams had stopped visiting Pakistan due to the country's deteriorating security situation, with an international tournament cancelled last year.
Australia and India refused to go on pre-planned tours, and it was with great difficulty that the Pakistani cricket authorities persuaded Sri Lanka to tour the country.
Sanath Jayasuriya, a Sri Lankan cricketer who was not part of the touring team, said that, even in conflict-torn Sri Lanka, cricketers never became the target.
"The good news is that they [the team] are all safe," Jayasuriya said.
Squad member Kumar Sangakkara told the Sri Lankan radio station Yes-FM that "all the players are completely out of danger". "Luckily there's nothing serious and everyone is fine."
The second Test between Sri Lanka and Pakistan ha been called off, according to a Sri Lankan cricket board official. "We are trying to bring the team back as quickly as possible. The test match has been cancelled," he told Reuters.
The former England all-rounder Dominic Cork who was in the stadium to do commentary work for Pakistan TV, told Sky Sports News: "The Sri Lankan players are quite shocked. They all fell to the floor of the team bus when the attack happened.
"Some of them have wounds but I think most of them are superficial wounds. I have spoken to ] Sangakkarra; he has a shrapnel wound in his right shoulder.
"The team are sitting in the changing room watching local TV. They are waiting for helicopters to arrive to take them to a local army base and wait for a connecting flight to Abu Dhabi."
Cork also spoke to former England opener Broad. "He said it was the most frightening experience of his life," Cork said. "Their driver was shot and they had to ask a policeman to drive them to the stadium."
The Sri Lankan president, Mahinda Rajapaksa, condemned the attack on his country's cricket team and called for the players to come home immediately.
In a statement, Rajapaksa, who is currently on a visit to Nepal, described the attack as cowardly. He ordered his foreign minister to immediately travel to Pakistan to help with the team's evacuation and ensure their safety.
Brigadier Udaya Nanayakkara, a military spokesman, said authorities did not believe the attack was carried out by the separatist Sri Lankan rebels, the Tamil Tigers.
Government forces are on the brink of defeating the rebels in the north and ending a 25-year civil war.
India's home minister, Palaniappan Chidambaram, speaking in New Delhi, said his country condemned the attack. "We are sorry for the Sri Lankan team," he said.
The police chief Haji Habibur Rehman said five officers died in the attack.
Today's developments will probably mean the end of international cricket in Pakistan for months, if not years."It is a terrible incident and I am lost for words," said the umpire Davis.
Nadeem Ghauri, a Pakistani umpire who witnessed the attack, said the umpires were behind the bus carrying Sri Lanka's players when they suddenly heard gunshots.
"The firing continued for 15 minutes," he said. "Our driver was hit, and he was injured."
The driver of one of the vehicles in the convoy told Pakistan's Express news channel that he saw a man firing a rocket towards their van. Someone then threw a grenade, but the weapons missed the vehicle.