The gunman who opened fire atop Mexico's ancient Pyramid of the Moon appeared to have been influenced by other violent shootings and showed signs of psychological problems, the country's president said on Tuesday.

Julio César Jasso Ramírez, 27, a Mexican national, carried a handgun, dozens of cartridges, a knife and literature referencing acts of violence, officials said on Tuesday.

Mexico's top prosecutor said Jasso Ramírez planned and carried out the attack alone. The gunman fatally shot himself after a standoff with police.

A Canadian woman was killed and 13 others were injured at the popular tourist site northwest of Mexico City.

"Based on everything indicated by the prosecutorial authorities, this person showed signs of psychological problems and was influenced by incidents that occurred abroad," President Claudia Sheinbaum said during a Tuesday media conference.