New norms must be regulated by Congress to set the values of fines that will punish violators, the official Agencia Brasil said.
The smoking ban in enclosed spaces was already in effect in states like Sao Paulo, Rio de Janeiro and Parana, in line with laws passed by local legislatures.
The new federal law requires all enclosed workplaces and public places to be smoke-free, bans tobacco advertising at point of sale, increases tobacco taxes and requires large health warnings on both sides of cigarette packs.
Currently the law requires graphic warnings covering the entire back of the pack, but no warning on the front.
Matthew Myers, president of the Washington-based Campaign for Tobacco-Free Kids hailed the Brazilian move.
"We applaud President Rousseff and the Brazilian Congress for taking truly historic action to reduce tobacco use and save countless lives," said Myers who is fighting to curb tobacco use and its effects both in the United States and around the world.
"In addition to protecting the health of its own citizens, Brazil has set an important example for the world, especially as it will be the host nation of the 2014 soccer World Cup and the 2016 (summer) Olympic Games," he added.
More than 17 percent of adults in Brazil smoke, and smoking kills more than 200,000 Brazilians each year, according to official data.