The bill also gave the mines minister wide-ranging discretionary powers to place certain minerals in a "value-addition" category, which means a portion of the extracted resource would have to be processed domestically instead of exported in raw form.
The speed in passing the bill ahead of general elections in May has alarmed petroleum operators such as Shell, Total and Exxon Mobil, which are looking to explore in South Africa in the wake of big offshore gas discoveries in neighbouring Mozambique.
It must still be signed into law by President Jacob Zuma before it becomes effective.
"There have been significant changes in recent days, which we have not been afforded an opportunity to comment on and which we are certain will have a chilling effect on investment in a high-risk and capital-intensive industry such as ours," the Offshore Petroleum Association of South Africa (OPASA) said in a statement ahead of the bill's passage in parliament.
Among its members are Shell, Anardarko, petrochemical group Sasol and BHP Billiton Petroleum.
According to the Petroleum Agency of South Africa, the country has attracted the greatest interest in exploration so far in its history, with both onshore and offshore acreage snapped up.
Shell has been exploring for shale gas in the onshore Karoo area, while Total said in November it expected to drill its first offshore well in the Outeniqua Basin, about 175 km off the southern coast of South Africa.
Australian junior explorer Sunbird Energy has been developing South Africa's largest stranded gas field, Ibhubesi on the west coast, which had estimated reserves of 540 billion cubic feet of gas.
In addition to the envisaged 20 per cent "free carried interest", the government introduced a new clause entitling it to further participation in the form of an acquisition at an agreed price or production-sharing agreements.
"This bill also gives government the power to nationalise at fire sale prices any drilling operation that finds oil or gas," James Lorimer, the opposition Democratic Alliance's shadow minister of mineral resources, said during robust debate.
"Drilling companies can be forced, after they have given away 20 per cent free carried interest, to give away the other 80 per cent of the find at any low price the government is prepared to pay," Lorimer said.
In mining, the aim of the bill is to create jobs in a country with an unemployment rate of around 25 per cent and to add value to its abundant natural resources, which include close to 80 per cent of the world's known platinum reserves.
Producers of designated minerals would have to offer a portion of their production to local processors in prescribed quantities, qualities and timelines at an agreed price.
"We are here to table this bill as one of the most progressive steps in improving and contributing to our economic development," Mineral Resources Minister Susan Shabangu told parliament.
(READ MORE: S. Africa mines minister to set law to streamline business)
The Mineral and Petroleum Resources Development Amendment Bill was passed by 226 to 66 votes in the African National Congress-dominated national assembly.