The final 62-56 vote came in the House where Majority Leader Hugh Holliman urged fellow House members to support the Senate version of the bill.
The Senate version bans smoking in nearly all restaurants and bars. It leaves out workplaces where children visit, which the House agreed to last month.
Holliman said the Senate version would be a good step toward protecting the public from secondhand smoke.
According to the state Division of Public Health, secondhand smoke is responsible for $289 million in state health care costs resulting from lung cancer and other diseases.
While the bill is meant to protect the public's health from second hand smoke, it provides some exceptions to private clubs, cigar bars and non-profit establishments and some feel like that is discrimination.
Opponents of the smoking ban also argue it violates the right of business owners to choose whether to allow smoking, and of their patrons.
"The bill that we have before us that we are being asked to vote on is as I've said before a terrible intrusion - a terrible governmental intrusion of personal freedom," Harnett County Rep. David Lewis said.
The bill now goes to Governor Beverly Perdue for her approval, and she has indicated she will sign it.
"Today is an important and historic day for North Carolina – a day to applaud Rep. Hugh Holliman and Sen. William Purcell for protecting the health of North Carolinians. I have vigorously supported efforts to reduce and eliminate smoking and this bill will help more North Carolina citizens avoid the dangers of secondhand smoke," she said in a statement released by her office.