No details were released on the suspects or victims, and prosecutors said the motive for the attack – in a small cafe in a residential neighourhood – was not known.
“Two men came into Cafe 56” around 8.15 pm local time (1915 GMT) “and fired several rounds,” said police in the picturesque city on the Rhine river in northwestern Switzerland.
“Two customers were killed. Another is in a critical condition”, they said in a statement.
The assailants escaped and headed in the direction of a city railway station after the attack.
“The reason behind the attack is not yet known and will be investigated,” the Basel prosecutor’s office said in a statement.
One neighbourhood resident said the cafe “was previously an establishment known for its links to the drug world.”
“But since the owner changed several years ago it became an ordinary cafe,” the resident told local newspaper Basler Zeitung.
The road next to the cafe was cordoned off and traffic redirected.
An AFP photographer at the scene saw police dressed in white forensic garb collecting evidence at the site early Friday.
A bullet hole was visible in one of the windows of the cafe.
Gun crime is infrequent in Switzerland, even though the country has one of the highest rates of firearm ownership in the world.
Citizens are allowed to keep their army-issue weapons at home outside periods of mandatory military service.
This right has been controversial as sometimes weapons are used at home in domestic incidents.
The number of weapons held at home is believed to be two million for a population of eight million, according to Swiss press.
In January, a man clad in military clothing shot and injured two police officers as they searched his home in northeast Switzerland for a suspected cannabis plantation.
The gunman fled but was eventually cornered and after a standoff lasting several hours, which included negotiations over the telephone, he shot and killed himself.
Police searching his home found gun publications.