Mexico President Enrique Peña Nieto has demanded that Egypt conducts a thorough investigation into the killing of at least two of its nationals, who were mistakenly shot dead by the army, along with another 10 tourists in the Egyptian desert.

Nieto said he was deeply saddened by the lives lost in what he described as a tragic incident. He tweeted: "Mexico condemns these acts against our citizens and has demanded an exhaustive investigation."

Egyptian security forces opened fire on a tourist convoy that was travelling in the western Sahara desert wrongly believing they were terrorists, the Egyptian interior ministry said: "A joint police and military force chasing terrorist elements in an oasis area of the western desert tonight, accidentally engaged four SUVs belonging to a Mexican tourist group. The incident resulted in the death of 12 Mexicans and Egyptians and the injury of 10 others who have been transferred to hospitals," the ministry said in a statement.

Authorities were investigating the circumstances of the incident, including why the tourists had entered an off-limits zone, the ministry added. Rasha Azazi, a spokesperson for the Egyptian Ministry of Tourism told AP that the tour company "did not have permits and did not inform authorities" about the convoy presence in the area. "They were not supposed to be there," she said.

Egypt has been fighting an Islamist insurgency for years. A jihadi group known as Ansar Beit al-Maqdis, which recently pledged alliance to the Islamic State (Isis), stepped up its operations against police and the army after President Abdel-Fattah el-Sisi took power in a military coup backed by street protests in 2014.

The Islamist militants have been predominantly active in the northern part of the eastern Sinai Peninsula but the vast desert areas on the other side of the country has also served them as hideout and possible smuggling route with the bordering civil-war-torn Libya.