The bill, passed by the lower house on Wednesday evening, criminalizes acts that damage “the sovereignty and national interest” of the southern African country.
In the most extreme cases, violators run the risk of up to 20 years in prison.
“What they are criminalizing is differing opinion against Zanu-PF… and this happens at the edge of an election showing without any doubt that the envelope of reform is being ignored,” said Ostallos Siziba, spokesman for the opposition Citizens Coalition for Change (CCC) party.
“Free speech is now dead,” prominent journalist and activist Hopewell Chin’ono wrote on Twitter, adding it was “a very sad day for Zimbabwe.”
The law was approved just hours after the government, ending months of uncertainty, announced nationwide elections for August 23.
Analysts are bracing for a tense ballot in a country where discontent at entrenched poverty, power cuts and other shortages runs deep.
Joseph Chinotimba, a lawmaker from the ruling Zanu-PF party, told parliament the new law aimed to encourage Zimbabweans to be “patriotic”.
“This bill is not meant to curtail the existence of political parties but it is there to encourage the people of Zimbabwe to love their country and stop denouncing it,” Chinotimba said.
He described the law as “noble… with good intentions”.
But opponents said it bans any criticism of the government at a time when rights groups and opposition parties are already complaining of a clampdown.
“Let history be known that I was not part of this commotion and circus,” opposition lawmaker Temba Mliswa told parliament before getting kicked out.
The law will now go to the Senate.
It will then need to be approved by President Emmerson Mnangagwa something Zimbabwe Human Rights NGO Forum director, Musa Kika, said was all but granted.
“This bill is the most draconian law that we have seen in Zimbabwe,” Kika said.
Eighty-year-old Mnangagwa, who replaced strongman ruler Robert Mugabe in 2017 after a military-led coup, is seeking a second term in August.
His main challenger is Nelson Chamisa, a 45-year-old lawyer and pastor, who leads the recently formed CCC party and narrowly lost to Mnangagwa in 2018.
The new legislation provides, among other things, for the punishment of those who actively partake in meetings where sanctions or a trade boycott against Zimbabwe are discussed.
The government has long complained about the impact of sanctions imposed by Western countries on a number of entities and individuals because of human rights abuses and corrupt practices.
“Not even Apartheid Rhodesia passed such a repugnant law,” former finance minister Tendai Biti, now an opposition politician, wrote on Twitter, referring to the British colony Zimbabwe was once part of.
The bill is the latest in a series of moves that critics say aim to shut down dissenting voices in the run-up to the elections.
In February, the government banned civil society organisations from engaging in politics, allowing the state to interfere in their governance and activities.
The opposition has also accused the ruling party of using the courts to sideline opposition politicians and says there has been an increase in arbitrary arrests and repression of rights groups.
Dubbed “The Crocodile” for his political cunning, Mnangagwa won a violence-stained election with 50.8 per cent of the vote at the last ballots in 2018.