Shortly before 9 p.m. on Saturday, Joaquín Guzmán Loera, the Mexican drug kingpin whose capture last year had been trumpeted by his country’s government as a crucial victory in its bloody campaign against the narcotics trade, stepped into the shower in his cell in the most secure wing of the most secure prison in Mexico.

He never came out.

When guards later entered the cell, they discovered a 2-by-2-foot hole, through which Mr. Guzmán, known as El Chapo, or Shorty, had disappeared.

The prison break humiliated the government of President Enrique Peña Nieto, which had proclaimed the arrest of Mr. Guzmán and leaders of other drug cartels as crucial achievements in restoring order and sovereignty to a country long beleaguered by the horrific violence associated with organized crime.

The opening in the shower led to a mile-long tunnel leading to a construction site in the nearby neighborhood of Santa Juanita in Almoloya de Juárez, west of Mexico City. The tunnel was more than two feet wide and more than five feet high, tall enough for him to walk standing upright, and was burrowed more than 30 feet underground. It had been equipped with lighting, ventilation and a motorcycle on rails that was probably used to transport digging material and cart the dirt out.