Only MPs from the far-right Freedom Party (FPOe) voted against the ban, which looks set to finally rid Austria of its status as the "ashtray of Europe".
The FPOe -- whose former leader Heinz-Christian Strache is himself a keen smoker -- had stymied a previous attempt to ban smoking in pubs and restaurants when it entered government in December 2017.
That prompted a backlash from large sections of the public and the Austrian medical association, which organised a petition in favour of the ban signed by almost 900,000 people, or around 14 percent of voters.
However, in May the FPOe left government under the shadow of a corruption scandal implicating Strache, paving the way for the smoking ban to come back before parliament.
"We are going to protect the health of hundreds of thousands of Austrians and prolong their lives," Pamela Rendi-Wagner, head of the main opposition Social Democrats (SPOe) -- and herself a doctor -- said after the vote.
Austria is currently led by a technocratic government after the so-called "Ibiza-gate" corruption scandal brought down the coalition between the FPOe and the centre-right People's Party (OeVP) and triggered early elections to be scheduled for September.
The scandal emerged when footage in May showed Strache in a luxury villa on the island of Ibiza appearing to offer public contracts to a fake Russian backer in an elaborate sting operation, forcing him to step down from all his posts.
Austria was one of the last European countries where smoking was still permitted in bars and restaurants, despite calls for bans dating back more than a decade.
Up until now, smoking has been legal in such establishments as long as it was done in a separate area -- although this rule was not always rigidly implemented.
No separate area was necessary in establishments smaller than 50 square metres (540 square feet) if the owner was happy to allow smoking on the premises.
However, a growing number of restaurants and cafes had already banned smoking of their own accord.