The shooting left police scouring about a 2-mile area of the city along the Mediterranean Sea, with roadblocks set up, national police spokesman Micky Rosenfeld said.
More than 15 rounds were fired in "a number of different directions" on a sidewalk outside the pub on Dizengoff Street -- a road famous for its shops, restaurants and bars -- Rosenfeld said. The shooting happened outside the Simta pub, according to an address provided by police.
"The Israeli national police ... are still investigating and trying to determine whether it is a terrorist attack or a criminal ... incident," Rosenfeld said.
Two surveillance videos aired by Israeli news media appear to show the attacker before and during the 2:40 p.m. shooting, hours before Shabbat, Judaism's day of rest that starts on Friday evening.
In one video, the apparent gunman stands in a store moments before the shooting. The person puts a bag down on a shopping cart, pulls out what appears to be a gun, steps outside and then points the weapon. As another person runs by, the first person slide-steps to keep pace, still pointing the gun.
In the other, the gunman is seen shooting outside. Nearby, alarmed patrons who were in what appeared to be an establishment's outdoor seating area hurry away.
Haim Pinto, owner of a jewelry store near the pub, said he was outside closing his shop when the shooting began.
"I saw people running shouting, 'Terrorist, terrorist!' " Pinto said in a telephone interview with CNN.
He said a shooter was "firing in every direction while he was running." Pinto said he went back into his shop, where he hid with two other people in a restroom.
"(It was) lucky that today was cold and wet, so that there were not too many people out," Pinto said. "Dizengoff Street on Friday is usually packed, and we are lucky that there was bad weather so there were not so many people."
Two Israeli nationals were killed, Rosenfeld said. Four other people were seriously injured, and three were moderately injured.
The shooting came at a time of heightened unease in Israel and Palestinian territories, with a recent wave of violence that has included stabbings and other kinds of attacks on civilians and Israeli soldiers.
Prime Minister Benjamin Netanyahu has called the spate of attacks, starting in October 2015, a "wave of terror." Twenty Israelis were killed from October to mid-November alone, with others injured, the government said.
Palestinian officials, meanwhile, have claimed Israeli authorities have repeatedly gone too far, saying that Israeli forces killed more than 80 Palestinians in the same period, a figure that includes protesters who died in clashes, as well as alleged attacks.