Enrique Peña Nieto
Mexico's President Enrique Peña Nieto Reuters/Bernardo Montoya

MEXICO CITY -- Mounting civil unrest and corruption concerns could slow the gusher of investment expected to flow into Mexico's newly open energy sector if not contained, analysts said. Oil-and-gas companies and private investors are watching to see if protests and police crackdowns escalate further, and if allegations of government graft continue to emerge.

"Their ears are raised," Oscar Silva, a partner with KPMG México's global strategy group, said. "Investors right now are more cautious. They're waiting to see how things develop."

President Enrique Peña Nieto, who took office two years ago Monday, has been praised so far by the private sector as an economic reformer. In August, he signed a landmark energy law to dismantle the state-run oil and electricity monopolies, enabling billions of dollars of foreign and private investment for the first time in decades. Moody's Investors Service raised Mexico's credit rating one level to A3 earlier this year in anticipation of the changes.

Mexico, the fourth-largest economy in the Americas, just replaced Brazil, the third, as the top choice of investors looking to enter Latin American markets, thanks to steady economic growth, falling labor costs and recent financial and banking reforms. The International Monetary Fund forecasts Mexico's growth at 2.4 percent for 2014 and 3.5 percent for next year; Brazil, by contrast, is expected to expand by 1.4 percent this year and 1.2 percent in 2015.

But Peña Nieto so far hasn't been able to curb the violence that plagues broad swaths of the country. In recent weeks, activists and students have seized on the disappearance of 43 rural teacher trainees to demand greater security and justice from the president. The 43 were likely killed by a local gang in cahoots with a local politician they opposed; their disappearance has ignited street protests directed at the president, who had been elected promising a new tack against drug cartels and crime.

Violent protests in the capital city and coastal town of Acapulco have raised questions about police tactics and the government's ability to handle demonstrations.

For investors, "the question is whether it gets to the point where it's uncontrollable," Brian Jacobsen, a chief portfolio strategist with Wells Fargo Funds Management in Wisconsin, said. If activists move beyond street protests and start shutting down crucial airports, highways and shipping ports -- hindering activity in Mexico's $1.3 trillion economy -- that would give companies pause.

The same could happen if Peña Nieto finds himself mired in more corruption accusations. Last month, an investigation by a Mexican news site linked his family's $7 million private residence to a company that won multiple contracts when Peña Nieto was governor of the state of Mexico. The same company was part of a consortium that won a $3.7 billion high-speed rail project, which was suspended after rumors began to swirl around the house.

As a candidate in 2012, Peña Nieto had assured that his party, the Institutional Revolutionary Party, or PRI, wasn't the same corrupt, repressive entity that ruled Mexico from 1929 to 2000.

"He was selling the PRI as a new party that learned from its old mistakes. This [scandal] is the first sign that perhaps not much has changed as people were led to believe," David Rees, an emerging markets economist with Capital Economics in London, said. He added that if "the news flows keep deteriorating, and these scandals get bigger and bigger, we might see some sort of pullback."

That would potentially affect coming bidding rounds for oil and gas development contracts in Mexico. Under the reform, foreign companies, including giants such as Exxon Mobil Corporation and Royal Dutch Shell, can compete for exploration and extraction projects in on-and-offshore reserves, though state-run Pemex still controls the majority of Mexico's proven and prospective resources. In the first bidding round, Mexico will auction off roughly 29,100 square kilometers (3,100 square feet) in project blocks -- an area that will require about $50.5 billion in investment from 2015 to 2018, according to Mexico's Energy Ministry.

"If the Mexican government gets this right, the investment will flow in huge quantities," KPMG's Silva said. "But if there's any signs of corruption or any wrongdoing, that could endanger investment."

If investors perceive a rising political risk in Mexico, the country's stocks could start trading at a discount compared to their emerging market peers, Jacobsen said. "There could be a significant revaluation of their economy if these concerns persist," he said.

Still, he and the other analysts said that for now, social unrest and government mismanagement haven't reached the point where investors are exiting Mexico. Where energy resources are abundant, emerging market investors have a relatively high tolerance for civil unrest and questionable government tactics, for example in Venezuela, Iran and Nigeria. Mexico has the world's sixth-largest reserves of shale gas, and oil output is expected to double now that foreign companies can participate in the sector.

Jacobsen said that Peña Nieto could quell investor concerns over corruption by taking a dramatic stand against it, as exemplified by the wide-reaching crackdown against bribery and nepotism in China led by President Xi Jinping. In Mexico, Peña Nieto "needs to do something that's very visible to clamp down on corruption," Jacobsen said. "Otherwise, then it's almost a tacit endorsement" of those phenomena.

The president said he's already taking steps to reduce violence and organized crime activity in state and local governments. Last week, Peña Nieto promised to reform the penal system and said he would propose a plan to Congress to improve police forces in Mexico's 31 states. "Mexico must change," he said in a televised speech.