Tens of thousands of people have rallied against President Enrique Pena Nieto's economic reforms in Mexico's capital, with leftist leader calling for peaceful resistance.

Mexico City police said more than 40,000 people gathered in a park on Sunday’s demonstration to reject plans to overhaul the tax system and open the country's state-controlled oil industry to foreign investors.

"We can prevent the privatisation of the energy sector and the tax increases through peaceful citizen mobilization," said opposition leader Andres Manuel Lopez Obrador, who never recognised his defeat to Pena Nieto in the 2012 presidential election after claiming fraud.

"These energy and tax reforms were prepared abroad for the benefit of foreign companies, a commitment that Pena Nieto made with foreign companies in the United States and Britain," he said.

He called the oil reform a "vile and shameful robbery".

Lopez Obrador made his plea as Pena Nieto prepared to present a revamp of the tax system to increase the government's revenue stream amid reports that he may propose a controversial sales tax for food and medicine.

President backs reforms

The Mexican president, who took office in December last year, has struck a pact with rival leftist and conservative parties that have secured telecommunications and education reforms despite protests by teachers.

Last Monday, he defended his reforms and urged Mexicans to back the "grand transformation" of the country, stressing that the overhaul was necessary to improve education, create jobs and improve a slowing economy.

Pena Nieto says the energy shifts aim to allow private firms to enter into profit-sharing agreements with state-run giant Pemex to modernise the company, but he denies plans to privatise an industry that was nationalised 75 years ago.

"They want to sell it, but the government is our employee. We, the Mexican people, are the owners," said Alberto Castro Gonzalez, a 45-year-old teacher who attended the demonstration.

With Pena Nieto having a deal with rival parties to pass the reforms in Congress, Lopez Obrador said: "The only thing that can stop these measures, which are contrary to the nation's interests, is citizens mobilising."

But despite holding several protests that have disrupted life in the metropolis of 20 million people in the past three weeks, the teachers ultimately failed to block Pena Nieto's education reform.