MEXICO CITY — Ever since the powerful drug lord known as El Chapo escaped from a maximum-security prison through a mile-long tunnel that opened right into the shower of his cell, Mexico has been wondering how his accomplices got their hands on the blueprints to operate with such pinpoint precision.

The answer could be quite simple: They may have had them for years.

It turns out that the prison is a virtual replica of another lockup that El Chapo, whose real name is Joaquín Guzmán Loera, broke out of in 2001 in an almost equally audacious escape.

In other words, he essentially broke out of the same prison twice.

The authorities believe that for his first escape — by some accounts, he sneaked out in a laundry cart — Mr. Guzmán had the help of a top prison security official who went on to become a trusted member of his Sinaloa cartel.