South Africa's parliament has adopted a bill meant to protect state secrets but that critics say will stifle freedom of speech and hamper democracy.
Tuesday's 259-41 vote with 32 abstentions came after months of fierce debate. Opposition groups said they will challenge the measure at the Constitutional Court if it does become a law.
The bill's critics included two Nobel prize winners: Desmond Tutu, the peace laureate, and Nadine Gordimer, a literature laureate.
The office of Nelson Mandela, South Africa's first post-apartheid president and another Nobel peace laureate, also expressed reservations about the bill.
Others who objected included newspaper editors, prominent writers, church groups, freedom of expression lobbyists, business leaders and others.
The governing African National Congress (ANC), which presented the bill, says South Africa needs to update apartheid-era legislation defining secrets and setting out punishments for divulging them.
The approval had been expected because the ANC holds a majority of parliament's seats, and party discipline is rarely violated. Parliament's upper house could ask for revisions, but that rarely happens.
Jacob Zuma, South Africa's president, will have to sign the bill to make it law, and while his legal advisers may ask for revisions, the Associated Press news agency reported that he was expected to do so.
The ANC bill reads "information that is accessible to all is the basis of a transparent, open and democratic society'', but says secrecy is sometimes necessary to "save lives, to enhance and to protect the freedom and security of persons, to bring criminals to justice, to protect the national security and to engage in effective government and diplomacy'.
While the bill makes it a crime to divulge state secrets, it also makes it a crime for an official to withhold information to conceal wrongdoing or incompetence, or merely to avoid embarrassment.
Critics wore black and staged protests at the ANC's downtown Johannesburg headquarters during rush hour on Tuesday.
Opponents of the bill said its weaknesses include its lack of a provision allowing those who break the law to avoid going to jail if they could argue they acted in the public interest.
Activists fear the adoption of the measure in a country known for one of the continent's freest and most open constitutions could influence other governments in the region.
In a statement late Monday, Tutu said it is "insulting to all South Africans to be asked to stomach legislation that could be used to outlaw whistle-blowing and investigative journalism ... and that makes the state answerable only to the state".
Tutu won a Nobel Peace Prize for his nonviolent opposition to white rule.
In more recent years, he has been a sharp critic of ANC moves he sees as undermining rule of law and weakening South Africa's fledgling democracy.
The ANC dismisses suggestions from critics that its proposal would take the country back to the days when white racist officials banned newspapers and punished whistle blowers to stifle criticism.
Prominent ANC members also have opposed the bill, among them a former state security minister.