The majority of foreign and domestic companies in Mexico say security has either improved or remained unchanged from last year, and almost half expect more improvement within five years.

In the survey conducted by the American Chamber of Commerce of Mexico, 42 percent of the 531 respondents said the security situation had improved.

"We attribute this mainly to the actions of the federal authorities and the measures undertaken by the companies themselves," said Thomas Gillen, president of the chamber's security committee.

Forty-two percent of respondents said the security situation had not changed and 13 percent said security had deteriorated. More than half of the latter group cited corruption as the cause of the deterioration.

According to the survey, 19 percent of companies surveyed said they expected the situation to improve by the end of the year, while 46 percent expected an improvement within the next five years. An additional19 percent expected the security situation to remain challenging for more than five years.

Extortion has become a problem for more companies, with 36 percent highlighting the issue this year, compared with 16 percent in 2011.

A third of the companies said they had faced security-related losses of up to $1 million, while 4 percent lost between $1 million and $5 million. Most companies surveyed said they spent between 2 and 4 percent of their budgets on security.

But only 2 percent said they had moved operations outside of Mexico as a result of the security situation. Five percent said they had moved operations within Mexico.

The areas causing the most concern were the northern states of Nuevo Leon and Tamaulipas, followed by the capital. The survey highlighted the central state of Queretaro, which is home to a booming aerospace and manufacturing sector, as one of the safest options.