MEXICO CITY—A federal judge was slain Monday in the state of Mexico, which borders the capital.

Vicente Antonio Bermudez Zacarias was a district court magistrate for appeals and civil judgments in the city of Toluca, according to a statement from Mexico’s Supreme Court. He was killed in nearby Metepec.

President Enrique Peña Nieto, speaking...