A manhunt is currently underway for the suspected shooter, said Tel Aviv Police Commander Ami Esshed.
The number of wounded was not immediately clear. In a speech on Israeli television, Eshed put the number at more than a dozen.
The attack happened at a bar on Dizengoff Street, a popular dining area in the city center, an Israeli police commander said.
Journalist Lauren Izso, who was at the scene shortly after the attack, estimated that hundreds of police officers were involved in securing the area and searching for the shooter.
In a speech on Israeli television, Tel Aviv Mayor Ron Huldai urged the city’s residents to stay at home.
The two people killed were men in their 30s, a spokesman for Magen David Adom said.
Tel Aviv’s Ichilov Hospital, where most of the casualties were taken, said doctors were fighting to save the lives of four wounded.
The shooting is the latest in a series of violent incidents that have embarrassed Israel and the Palestinian territories.
In just one week in March, eleven people were killed in three attacks in Israeli cities. It was the deadliest week Israel had experienced in years and followed weeks of rising tensions that saw Israelis stabbed and several Palestinians shot dead by Israeli forces in the West Bank.
That wave of attacks included five people who were killed east of Tel Aviv in the ultra-Orthodox town of Bnei Brak.
It’s not clear if Thursday’s shooting is related to the recent violence.
Militant groups in Gaza and the West Bank praised Thursday’s attack, although they did not claim responsibility.
Hamas called it a heroic operation, while Islamic Jihad promised “the resistance will continue.”
United Nations Special Coordinator for the Middle East Tor Wennesland condemned the attack and singled out Hamas in a tweet, saying: “Regret Hamas’ welcome of this attack; there is no glory in terror. These attacks must stop now and be condemned by all.”
CNN’s Abeer Salman, Ibrahim Dahman, Andrew Carey, and Hadas Gold contributed to this report.