The Mexican Congress has approved controversial legislation that opens the state-controlled oil sector to foreign investment.
The new energy law allows private oil and gas companies to drill for oil and gas with the state-run firm Pemex in exchange for a share of the profits.
It has been approved by the Chamber of Deputies a day after being passed by the upper house, the Senate.
Opposition lawmakers protested vigorously against the bill.
The Chamber of Deputies voted 354 to 134 to give general approval to the bill.
President Enrique Pena Nieto says private investment is needed to modernise the energy sector.
"The energy reform is a fundamental transformation, which will enable Mexico to strengthen its sovereignty and energy security," Mr Pena Nieto posted on his Twitter account after the vote.
He said the new legislation "will also boost economic growth and the creation of new jobs" in the country.
Private firms will be allowed for the first time since 1938, when the sector was nationalised, to explore and extract oil and gas with state-run firm Pemex - and take a share of the profits.
'Stripping the nation'
The opposition said the new legislation would damage the national interests of Mexico.
The were scuffles during the long debate in the lower house of the Mexican Congress.
Landy Berzunza of the governing PRI party was taken to hospital with a scratched retina after an altercation with opposition MP Karen Quiroga.
Throughout the debate members of the opposition Democratic Revolution Party (PRD) tried to disrupt the proceedings to prevent the passage of the bill.
Some occupied the podium in the main chamber.
Others barricaded the chamber's entrances to prevent MPs from the PRI, PAN and Nueva Alianza parties, who backed the reform, from entering.
MP Antonio Garcia Conejo, from the PRD, stripped down to his underwear to show his rejection of the bill.
"This is how you're stripping the nation. Where is the benefit? I'm not ashamed, what you're doing is a shame!" he said as he dropped his trousers and removed his socks.
Left-wing lawmaker Ricardo Monreal took to the podium with a thermos can, saying it was a time capsule in which he would put the names of the "traitors of the fatherland" who had voted for the reform bill.
Shouts of "ruffians" and "traitors" could be heard throughout the debate, while some MPs made obscene gestures at others who had interrupted them.
Members of the governing PRI party said the bill was crucial to drive Mexico's economy forward and to better exploit Mexico's oil riches.
Oil production in Mexico has dropped from 3.4 million barrels per day in 2004 to the current rate of 2.5 million barrels per day.
The bill is a key part of President Enrique Pena Nieto's drive to reform the Mexican economy.
It still needs to be approved by 17 of Mexico's 32 federal entities - the District Federal and 31 states.