Updated

Mexican President Enrique Pena Nieto pressed on with his reform agenda, unveiling a tax system overhaul after tens of thousands of people rallied against his policies.

Changing the tax code, aimed at boosting the government's coffers, is among a series of reforms championed by Pena Nieto, along with a controversial plan to open the oil sector to foreign investment.

The latest reform would raise taxes on higher earners, levy a capital gains charge and even impose a special tax on soft drinks to pare the country's high obesity rate.

But he said he decided not to impose a sales tax on food and medicine in order not to harm the poor amid an economic slowdown.

Such a tax would have likely further angered protesters in a country where 45 percent of the population of 112 million -- lives in poverty.

"(The reform) will help reduce the high level of inequality between Mexicans," Pena Nieto said in a speech from his presidential residence. "Those who make more will pay more and those who have less will have more benefits."

Pena Nieto said the tax reform aims to raise government revenue in order to provide pensions for all retired Mexicans and unemployment insurance.

Citing an economic slowdown that reduced the 2013 growth forecast from 3.5 percent to 1.8 percent, Pena Nieto also announced that the government would go into deficit in the next two years to stimulate the economy.

Hours earlier, the runner-up in the 2012 presidential election, leftist leader Andres Manuel Lopez Obrador, led a rally against Pena Nieto's reforms in a Mexico City park that drew at least 44,000 people, according to police.

Calling the energy reform a "vile and shameful robbery," the former Mexico City mayor urged Mexicans to resist peacefully and join him at another demonstration in the capital on September 22.

"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," Lopez Obrador said.

Pena Nieto, who took office in December, touted the "transformational reforms" he is pushing through a pact he signed with rival leftist and conservative parties.

The Pact for Mexico has led to the passage in Congress of a reform of the telecommunications sector as well as an overhaul of the education system despite several protests led by teachers in the past three weeks.

Reforming the energy industry could prove more difficult in a country where many are still fiercely proud of the nationalization of the industry 75 years ago.

Pena Nieto wants to allow private firms to enter into profit-sharing agreements with state-run energy giant Pemex to modernize the company, but he denies plans to privatize the industry.

Speaking on a stage in front of a giant banner that read "No to the biggest robbery of all time," Lopez Obrador said the tax overhaul will dig into the pockets of ordinary Mexicans to make up for losing Pemex profits.

"Oil is the engine, the fuel of our society. It's an essential and profitable product that belongs to society," said Alberto Castro Gonzalez, a 45-year-old teacher wearing a poster of a barrel of oil with the words "Mexico is not for sale."

"They want to sell it, but the government is our employee. We, the Mexican people, are the owners," he said.