With ballots counted in all 96 districts, the anti-smoking camp had 61 percent of the vote although turnout was a low 37.7 percent. A simple majority was needed for victory.
The result will lead to new rules that will be the strongest in the country, banning smoking in all pubs, restaurants and beer tents, without exception.
Existing laws allow smokers to light up in beer tents and pubs with special smoking rooms.
The referendum, in which about 9.4 million people were eligible to vote, sparked a furious debate with those in favour of a total ban arguing for health considerations and opponents putting forward arguments about freedom of choice.
Those in favour of stamping out smoking hope a ban in Bavaria will lead to stricter rules across the country where various loopholes in smoking legislation have led to weak enforcement for existing rules.
Smokers heading for this year's 200th anniversary of the beer-guzzling Oktoberfest should not necessarily leave their cigarettes at home, however.
According to local media, authorities have already announced any potential ban would not be in place for this year's festival, which last year attracted 5.7 million visitors from all around the world.