Damaso Lopez, the right-hand man of jailed drug lord Joaquin 'El Chapo' Guzman, was captured on Tuesday with the help of the Mexican army.
The former security official is believed to have been involved in a bloody struggle for the Sinaloa drug cartel with the sons of the notorious drug kingpin.
The Sinaloa cartel was destabilised after their former boss Guzman was extradited to the US in January.
Lopez - who is nicknamed 'The Graduate' - was captured in an apartment in a middle-class neighbourhood a few weeks after a video emerged of him eating at a Mexico City restaurant.
Mexican TV showed a convoy of white vehicles driving him through the city to appear before the attorney general.
Officials believe he played a role in orchestrating Guzman's first escape from prison in 2001, before joining the cartel.
Guzman, who was flown to New York to stand trial for drug trafficking the day before Donald Trump became President, was recaptured last year after managing to break out of a maximum-security prison through a mile-long tunnel in his cell.
It was the second time the notorious drug lord had managed to escape from prison in a spectacular fashion.
With Guzman in jail, the Sinaloa cartel has been controlled by Lopez, Ismael 'El Mayo' Zambada Garcia and Rafael Caro Quintero, and Guzman's son Ivan Archivaldo Guzman.