The tourists were travelling in four vehicles that entered a restricted zone in the Wahat area of the Western Desert, a ministry statement said.
Ten Mexicans and Egyptians were also injured and are being treated in a local hospital.
The ministry said it had formed a team to investigate the incident.
Mexico’s President Enrique Pena Nieto condemned the incident and said he had “demanded an exhaustive investigation by the Egyptian government”.
The Mexican foreign ministry confirmed that at least two of its nationals had been killed and said it was working to confirm the identities of the other victims.
In a statement, it said Mexico’s ambassador in Egypt, Jorge Alvarez Fuentes, had visited the local hospital and spoken to five Mexicans who were in a stable condition.
‘Mistakenly dealt with’
The statement (in Arabic) from Egypt’s interior ministry said the four vehicles the tourists were travelling in were “mistakenly dealt with” during a joint military police and armed forces operation.
It said the incident happened on Sunday in an area that “was off limits to foreign tourists”, but it did not give an exact location.
Egyptian officials say the tourists were in a no-go zone – and had not liaised with the authorities.
But a local tour guide has denied that, saying the group was in an unrestricted area, on top of sand dunes, trying to get a bird’s eye view.
Another local source – who claims to have spoken to a driver who survived the incident – told the BBC that the tour company had co-ordinated with officials and even had a police escort.
The group of tourists was preparing to camp out in the vast Western Desert when they came under fire.
According to the interior ministry’s statement, the security forces were pursuing Islamic militants in the desert, and targeted the four vehicles which were away from the main road with an Apache helicopter, which shot and hit the four vehicles.
The vast Western Desert area is popular with foreign sightseers, but is also attractive to militants, reports the BBC’s Orla Guerin in Cairo.
Last month, a Croatian engineer was beheaded there by the so-called Islamic State (IS).
The area – which borders Libya – is a gateway to the long border and weapons are available on the other side, our correspondent adds.
On Sunday, IS in Egypt claimed it had “resisted a military operation” in the desert.
A group claiming to be affiliated with IS also said on Sunday that it was present in Farafra.
The insurgency in Egypt gathered momentum after the army overthrew Islamist President Mohammed Morsi of the Muslim Brotherhood in mid-2013 following protests against his rule.
The government says hundreds of police and soldiers have been killed, many of them in attacks claimed by IS’s Sinai Province affiliate.
Up until recently most of the fighting has taken place in the Sinai Peninsula with occasional attacks taking place in Cairo and other cities.
In July, Egypt vowed to rid the Sinai Peninsula of militants after major clashes with IS fighters there killed more than 100 people.
It said that operations will not stop until the area is cleared of militants.