The Public Health and Wellbeing Amendment (Pandemic Management) Bill passed the upper house 20 votes to 18 on Thursday.
Transport Matters MP Rod Barton, Animal Justice Party MP Andy Meddick, Reason Party MP Fiona Patten and Greens leader Samantha Ratnam voted with the government.
The bill received final approval later the same day in the lower house, where the government has a commanding majority, following the opposition unsuccessfully moving more amendments.
After receiving royal assent from the governor of Victoria, the laws will come into effect from December 16, when a current state of emergency expires.
Under the legislation, the premier and health minister will have the power to declare a pandemic and enforce orders such as lockdowns, mask-wearing, vaccination mandates, and quarantine.
The pandemic orders can differentiate between cohorts of people based on characteristics such as age and vaccination status, relevant to the public health risk.
Under the current state of emergency, those powers lie with the chief health officer, who is an unelected official.
Premier Daniel Andrews said even though the state of emergency was to expire, the pandemic was "not over".
"In order to protect the vulnerable, in order to keep us safe and keep us open, we have to recognise this is not over, there are still things that have to be done, rules that need to be in place," he said.
Mr Andrews said vaccine mandates "won't be forever" but flagged they may remain in place until booster shots were rolled out and children under 12 vaccinated.
The upper house spent 21 hours this week debating several amendments to the bill, which were made to secure the support of Mr Barton after former Labor minister Adem Somyurek announced he would return from a self-imposed absence to vote against it.
Mr Somyurek was in the chamber when the final vote occurred on Thursday.
Ms Ratnam said the state came "very close" to being one of the only places in the world without public health laws during the COVID-19 pandemic, and was "troubled" by debate surrounding the bill.
"To see members of the upper house spread misinformation and mislead the public debate has been devastating because I have seen what it has led to," the Greens leader said, adding she and her staff had received threats against their lives.
The legislation became a lightning rod for anti-lockdown and anti-vaccination groups, who have occupied the steps of state parliament for weeks in protest.
Opposition Leader Matthew Guy said he was disappointed the bill passed and reaffirmed his commitment to scrap it if he wins the 2022 election.
"(It is) bad policy, bad laws, which are rammed through the parliament with no consultation or very limited consultation and that come at the expense of average Victorians," he said.
Thursday marked the last sitting week of the year for the lower house.
The upper house will return on Friday to pass bills to implement the recommendations of royal commissions into Crown casino and the Lawyer X scandal, and another that establishes a body to oversee the state's recycling sector and a new four-bin system.
Parliament is due to return on February 8 ahead of the state election, scheduled for November 26.