South Africa's parliament voted Thursday in favour of a fiercely contested secrecy bill which critics say will muzzle the media and provide cover for government corruption.
The Protection of State Information Bill, which would replace apartheid-era legislation on classified information and espionage, passed with 189 votes in favour to 74 against, with one abstention.
The minister of state security, Siyabonga Cwele, told parliament the bill would "strengthen democracy while balancing transparency and protecting our national security and national interests".
"There is no one who can hide corruption through this act," he said, adding that the revised bill provided whistleblowers even more protection.
Under the bill, espionage-related cases carry a punishment of up to 25 years in jail, and holding or disclosing classified material carries a maximum of five years' imprisonment.
The bill has met fierce opposition from the media, rights groups and the opposition, which fear it will be used to persecute whistleblowers and stifle press freedom in country where the media regularly uncover government corruption and wasteful spending.
In recent years journalists have used leaked documents to level accusations of high-level corruption against leading members of the ruling African National Congress (ANC).
They included President Jacob Zuma, who was implicated and appeared in court on charges relating to a arms deal. The charges were dropped just months before he became head of state.
Press reporting has also led to allegations that Zuma spent tens of millions of dollars of taxpayers' cash to renovate his private home.
Since first mooted in 2008, the bill has undergone several amendments, but was ultimately pushed through by the ANC's overwhelming parliamentary majority.
Opposition Democratic Alliance (DA) parliamentary leader Lindiwe Mazibuko slammed the bill as a "unconstitutional" and a threat to "democracy's foundational values of freedom and openness".
"Media cannot function when important information is suppressed. Bad governance thrives under the cloak of darkness. Those who have nothing to hide have nothing to fear," she said.
The DA said it would lobby other opposition parties to challenge the bill in the Constitutional Court.
The bill is now expected to be signed into law by Zuma.