South African MPs have approved a controversial media bill after a three-year battle over the legislation.
Dubbed the "secrecy bill", lawmakers say the Protection of State Information Bill will safeguard state secrets.
It has been substantially altered during its passage through parliament.
Critics say it still does not provide enough protection for whistleblowers exposing corruption, with penalties of up to 25 years in jail for revealing classified information.
It was passed by 189 votes to 74, with one abstention in the National Assembly, where the governing African National Congress (ANC) has an overwhelming majority.
Pubic interest clause
State Security Minister Siyabonga Cwele said the law would "strengthen democracy while balancing transparency and protecting our national security and national interests", AFP news agency reports.
"There is no-one who can hide corruption through this act," he said.
But the main opposition Democratic Alliance (DA) party described the bill as "unconstitutional" and urged President Jacob Zuma to refer it back to parliament for further amendments.
"In the event that this should fail, I have already begun to lobby the leaders of other political parties in parliament, to refer the law directly to the Constitutional Court," the DA's parliamentary leader Lindiwe Mazibuko said in a speech before the vote.
The Right2Know campaign group has also said it intends to take legal action if the president signs it into law.
The legislation "would add to the generalised trend towards secrecy, fear and intimidation growing in South Africa today", the group said in a statement.
The South African National Editors' Forum (Sanef) said President Zuma had the option of referring it directly to the Constitutional Court, the highest court in South Africa.
It said the changes to the bill made by the upper house of parliament late last year had improved the legislation in "important ways".
"But they do not go far enough. The bill still has the potential to be used as an instrument of secrecy in a democracy that can only thrive in a climate of openness," Sanef said in a statement.
The revised bill has removed provisions that would have allowed almost any government agency to classify material, Reuters news agency reports.
Public interest provisions have also been introduced into the bill, which was first passed by the lower house of parliament in November 2011.
But Right2Know says this does not stop whistleblowers, journalists or activists who disclose classified information from being charged with "espionage" and "hostile activity".
The group said there was also a need for a "public domain defence" so that once a secret was in the public domain a person could not be prosecuted.