Austrian Chancellor Sebastian Kurz called it a "repulsive terror attack" and said one gunman was also killed.
Police were searching for at least one attacker who was still at large, the interior minister said.
The shootings took place near Vienna's central synagogue but it is not yet clear if that was the target.
One of the victims was killed at the scene of the shootings while a second - a woman - died later in hospital from her wounds, Mayor Michael Ludwig said. It is believed 14 other people remain in hospital, six in a serious condition.
A police officer is among the injured, the interior ministry said.
The attack happened just hours before Austria imposed new national restrictions to try to stem rising cases of coronavirus. Many people were out enjoying bars and restaurants which are now closed until the end of November.
European leaders strongly condemned the shooting. British Prime Minister Boris Johnson said he was "deeply shocked by the terrible attacks".