Mexican drug lord Joaquín "El Chapo" Guzmán was recaptured on Friday, six months after he escaped from maximum-security prison through a mile-long tunnel beginning inside his cell.

The arrest took place in the morning in the northern city of Los Mochis in the state of Sinaloa, which is Chapo's home state and the bastion of his Sinaloa cartel — the biggest drug trafficking organization in Mexico with networks stretching across the world.

The infamous capo was then flown to the capital where he was marched in front of media cameras and into a navy helicopter due to take him back to the same prison he broke out of.

Attorney General Arely Gómez told reporters that the intelligence operation to recapture Chapo had received a major boost "when it was discovered that Guzmán Loera was intending to film a biographical film, to which end he sought communication with actors and producers."

She said that while the leader of the Sinaloa Cartel spent most of his half-year of freedom living in the so-called Golden Triangle region of the Sierra Madre — an area famed for the cultivation of opium poppies and marijuana — his plans to move to an urban setting were discovered at the end of December.

The circle closed further, she added, when the manhunt identified a "specialist in the construction of tunnels" who was busy adapting safe houses in several places, seemingly reaffirming the drug lord's trust in underground methods of escape.

Earlier in the day President Enrique Peña Nieto celebrated the arrest as proof that Mexico's much-questioned institutions are capable of anything.

"Today our institutions have shown that citizens can trust them," he told reporters called to the imposing National Palace in Mexico City to hear his message. "They have the stature, strength and determination to accomplish any mission that they are given."

The operation that led to Chapo's arrest started before dawn at a house in a middle class neighborhood known as Las Palmas with the ensuing shootout reportedly lasted about 40 minutes.

Attorney General Gómez said Chapo and his head of security escaped from the house into the city storm drainage network. With federal forces in hot persuit she said they returned to the surface and continued their doomed getaway in stolen cars but didn't get very far before they were arrested and taken to a nearby motel while reinforcements arrived.

The president stressed that the operation involved the participation of officials from all of Mexico's security apparatus, though it appeared to have been led by the navy. The first details of what happened came from a navy statement indicating that they had got Guzmán after an anonymous tip off led them to a residence filled with gunmen who opened fire when the marines arrived.

The statement said that five alleged gunmen were killed in the operation, six people were arrested, and one official was wounded. It added that the navy also seized four vehicles, two of which were bulletproof, eight assault rifles, one pistol, and a rocket launcher.

Photo via a source in Sinaloa showing Chapo Guzmán after his capture

The navy is reputedly more reliable and less corrupt than other Mexican law enforcement agencies and is regularly entrusted to lead operations targeting the country's highest profile kingpins.

The navy was at the forefront of Guzmán's last arrest in February 2014, when he was captured in a condominium in the resort city of Mazatlán, also in Sinaloa. On that occasion he was alone with his wife and twin daughters, and the detention was carried out without a shot being fired.

That operation was billed as a major success for the Peña Nieto government that had promised to bring greater effectiveness to the struggle to contain the country's drug cartels. Well over 100,000 people have been killed in violence associated with Mexico's drug wars that sharply intensified in the wake of a major military-led operation against organized crime launched by Peña NIeto's predecessor President Felipe Calderón in 2006.

But the celebration of picking up the biggest drug lord of all turned to humiliation when he slipped out of his cell on July 11 last year through a tunnel that began in the tiny shower area.

Footage from the surveillance camera that watched his every move 24 hours a day showed Chapo pacing around his cell shortly before he went into the shower and then disappeared from view.

Officials did not arrive at the cell to look for the missing drug lord until about half an hour later in a clear indication of the level of corruption behind the dramatic jailbreak.

The escape was particularly embarrassing because the government had dismissed skepticism that Chapo could be held safely in a Mexican prison, given that he had already broken out of a high security jail in 2001. At that time, Guzmán was a second-tier figure in the Sinaloa cartel. By the time he was detained again in 2014, he was one of the most famous, and infamous, drug traffickers in the world. His second escape 17 months later turned him into a near myth.

Watch VICE News' 'Inside El Chapo's Escape Tunnel'

The US Drug Enforcement Administration (DEA) welcomed his recapture on Friday with a tweet that also congratulated the Mexican government and hailed "the bravery" involved in the operation.

DEA is extremely pleased at the capture of Chapo Guzman. We congratulate the MX Government and salute the bravery involved in his capture — DEA News (@DEANEWS)January 8, 2016

U.S Attorney General Loretta Lynch issued a statement calling the events of the day "a victory" for the citizens of both Mexico and the United States.

"Guzman's latest attempt to escape has failed," she was cited as saying. "He will now have to answer for his alleged crimes, which have resulted in significant violence, suffering and corruption on multiple continents."

Meanwhile, rumors began to circulate that, this time, Chapo would soon be extradited to face trial in the United States.

President Peña Nieto's glorification of Mexican institutional capability in his message on the capture might suggest a reluctance to do this.

"This is a big moment for Mexico," security expert Alejandro Hope told VICE News. "It is a huge decision for Enrique Peña Nieto whether or not to extradite him, but I believe that at some point he will."

Former DEA agent Gilbert González told VICE News that he had information that the US government would be immediately requesting extradition.

"The Mexican marines wanted him dead, and the DEA alive," he also claimed. "It's a good thing for him and for us he got captured alive. We can't allow him to escape again from a Mexican prison."

The news that Chapo was in custody prompted jubilant reactions from top members of Peña Nieto's cabinet and diplomats.

During a gathering of the Mexican diplomatic corps in Mexico City, Interior Minister Miguel Angel Osorio Chong reportedly left a podium to take a call from the president. When he returned, the minister said he had very important news, and read the president's tweet with a wide smile. The diplomats broke into cheers and applause while Osorio Chong hugged Mexico's army chief Gen. Salvador Cienfuegos, the navy chief Gen. Vidal Francisco Soberón, and foreign minister Claudia Ruiz Massieu.

The gathering then spontaneously sang Mexico's national anthem.

Nathaniel Janowitz, Alan Hernández, Daniel Hernandez, and Luis Chaparro contributed to this report.