MEXICO CITY (AP) — The capture of Joaquin "El Chapo" Guzman followed the most intensive manhunt in modern Mexican history, with at least 2,500 security and intelligence agents dedicated to getting a man whose escape had personally embarrassed the nation's president.

The government says the hunt involved piecing together information from intelligence, data, interrogations and raids — as well as monitoring actors Sean Penn and Kate del Castillo as they came to interview the world's most wanted trafficker.

While Mexican authorities had spent decades chasing Guzman, the chase following his July escape from a top-security prison was different for two reasons, said a former government intelligence official who spoke on condition of anonymity because he wasn't authorized to discuss the case.

"One, El Chapo stopped being clandestine. He left the mountain. He met with people, as we now know. That made it easier for intelligence units to find him," said the ex-official, who maintains sources inside security operations. "The other factor: there were, from the time of the escape, 2,500 people from various security agencies exclusively dedicated ... to mount a successful operation."

President Enrique Pena Nieto's office and the attorney general's office didn't respond to attempts by The Associated Press to confirm the number, but others who had been briefed said it was at least 2,500.

Even so, it took six months to catch him, with Mexican news media carrying repeated reports of marine raids into the mountains of Guzman's native Sinaloa state.

Guzman was nabbed early Friday morning after a shootout in the city of Los Mochis that killed five of his men and wounded one marine.

The former official interviewed Guzman when he was arrested the first time in 1993 and led operations over the years in the remote mountains of Sinaloa and Durango states, known as the Golden Triangle, after Guzman first escaped a maximum security facility in 2001. He said the size of those operations involved only around 60 troops, not hundreds.

"It was obviously expensive, but they knew they had to flush Chapo Guzman out," said Michael Vigil, former head of international operations at the Drug Enforcement Administration, who also was briefed on the operation. "The only way was by saturating the area where he was.

"It caused him to go to a safe house in Los Mochis. He knew that was going to make him vulnerable, but he had no choice.

Every phone call or text, every movement in the region was analyzed, the ex-official said, including Guzman's Oct. 2 meeting with Penn and del Castillo.

He and Vigil said that Del Castillo's phone calls, texts and other communications must have been monitored since she had her first real contact with Guzman last year, while he was still in prison. Everyone wanted to tell his story, but he said he would only work with the Mexican actress, who the ex-official called "Mexico's Sharon Stone."

"The movie was secondary. The first motivation was meeting Kate del Castillo and striking a relationship there," Vigil said, citing intelligence sources.

Four days after Penn's Oct. 2 interview, soldiers staged fierce operations in the area of Tamazula, Durango, where the meeting with Penn and Del Castillo took place. The ex-official said it took that time to put together the intelligence and mount a raid.

In the end, Guzman narrowly escaped.

Security teams had kept watch on several properties related to Guzman in and around Los Mochis since October, he said. But it was only last week that they started noticing a flurry of activity in one of the houses in an upscale neighborhood. Intelligence indicated that Guzman's wife, Emma Coronel, had arrived with their twin daughters to celebrate the Feast of the Three Kings, a major Christmas-season holiday for Mexican children.

The timing wasn't an accident, the ex-official said. Holidays and birthdays are the best times to catch suspects.

"They try to be with family, and intelligence units take advantage of these contacts to find out where they are," he said.

In the end, the ex-official attributed Guzman's capture to the drug lord "losing his footing."

When they first met, Guzman was a mid-level capo without the folk hero image he has today. He was cautious and humble, addressing authorities in the most formal manner of speech. He could barely write, but is very intelligent, the ex-official said.

Today, the official said, he sees a man who let his ego take over.

Authorities found DVD's of Del Castillo's series, "The Queen of the South," in which she plays a drug lord, when they raided his Los Mochis home. Both Penn and the government said Guzman hoped to arrange his own movie.

"He fell in love with his own legend," the ex-official said.

__________

Follow Katherine Corcoran on Twitter @kathycorcoran