A manhunt is currently underway to locate the suspected shooter, Tel Aviv Police Commander Ami Eshed said.
The number of injured was not immediately clear. Speaking on Israeli television, Eshed put the number at more than a dozen.
The attack happened at a bar on Dizengoff Street, a popular downtown restaurant, an Israel Police commander said.
Journalist Lauren Izso, at the scene shortly after the attack, estimated that hundreds of police were involved in securing the area and searching for the shooter.
Speaking on Israeli television, Tel Aviv Mayor Ron Huldai told residents of the city to stay at home.
The two people killed were men in their 30s, a Magen David Adom emergency services spokesman said.
Tel Aviv’s Ichilov Hospital, where most of the injured were taken, said doctors were battling to save the lives of four injured people.
The shooting is the latest in a series of violent incidents that have put Israel and the Palestinian territories on edge.
In just one week in March, 11 people were killed in three attacks in Israeli towns. It was the deadliest week Israel has seen in years and follows weeks of rising tensions that have seen Israelis targeted in stabbings and several Palestinians shot dead by Israeli forces in the West Bank.
It is unclear whether Thursday’s shooting is related to the recent violence.
Militant groups in Gaza and the West Bank welcomed Thursday’s attack, though they refrained from claiming responsibility.
Hamas called it a heroic operation, while Islamic Jihad vowed “the resistance will continue”.
Condemning the attack, UN Special Coordinator for the Middle East, Tor Wennesland, singled out Hamas in a tweet, saying, “Deplore Hamas’ reception 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.