Sean Penn’s interview with Mexican drug lord “El Chapo” cast the Oscar-winning actor as a Rolling Stone journalist, but it may have been just an elaborate role-research ruse to protect him from prosecution, according to one former federal agent who closely monitored Penn’s trip south of the border.

Penn, who is known for throwing himself into the characters he plays, filed a 10,000-word article that broke little ground and was declared a “failure” by Penn himself following the early October meeting at Joaquin “El Chapo” Guzman’s jungle compound. While the story was a coup in the sense that Penn was able to track down one of the world’s most wanted men, the real purpose, according to a federal agent involved with the pursuit of El Chapo, probably was to get the combative actor around a federal law.

“Meeting with El Chapo about making a movie about him would have been violating U.S. law, which prohibits dealings with a ‘significant foreign narcotics trafficker,’” the government source told FoxNews.com. “Penn said his story was a ‘failure’ because the real objective was to ignite the debate on how the war on drugs is a failure, but it is not a failure if he lands in the role of a lifetime.”

Penn is known for taking extraordinary measures in preparation for his movie roles -- adhering to special diets and fitness regimes, obsessively reviewing documentary and archival footage, conducting site visits and meeting with people whose mannerisms he will emulate. For his role in “I Am Sam,” he spent time at an LA facility for the mentally handicapped.

“If he plays El Chapo, he will play the role perfectly."

- Axel Uriegas Duarte, director of “Chapo, The Escape of the Century”

Penn also has traveled to countries such as Haiti, Iraq, Iran, Venezuela and Cuba, where natural disasters and violent conflict have impacted thousands of lives. For his most recent foray, Penn spent seven hours deep in the Mexican jungle with one of the most dangerous and feared criminals in the world, seeing El Chapo in lair and with his top lieutenants and sons by his side, the ultimate opportunity should he play El Chapo in a movie.

“Sean Penn is one of the best actors in the world,” said Axel Uriegas Duarte, director of the recently released film “Chapo, The Escape of the Century.” “If he plays El Chapo, he will play the role perfectly.

“To make movies more realistic, Sean Penn should meet with the people he will play,” Duarte added.

Immersing oneself into the stoner world of “Fast Times at Ridgemont High” character Jeff Spicoli aside, most role research does not need to involve breaking the law. But under federal law, no U.S. citizen can do business -- or even discuss business -- with a U.S. Treasury Department-certified drug kingpin, and El Chapo has been included on that list since 2001. Doing so is a criminal violation punishable by up to 10 years in prison and large fines.

Hence, to prepare for a potential turn as El Chapo, Penn wrapped himself in the protection of the First Amendment, said the source. Charging Penn under the statute would be more difficult given the courts’ time-honored deference to freedom of the press, but he could still be prosecuted if federal authorities uncover evidence pointing to another purpose for the meeting.

Penn traveled with Argentine film executives Fernando Sulichin and José Ibáñez-Martín Pira, associates of film director Oliver Stone, who last year acquired the film rights to “The Cartel,” a book by Don Winslow that offers a window into the life of El Chapo, who some reviewers say comes off like a Mexican version of Don Corleone. Also on the trip was Mexican actress Kate Del Castillo, who El Chapo’s attorney reportedly approached in 2014 about a proposed biopic on El Chapo.

“Sean Penn seems to be bending over backward to say it was purely journalistic, but the info we were given about the trip, there was never any reference to an interview for a Rolling Stone article until he met with El Chapo,” the government source said. “I think this was a very calculated move on the part of Sean Penn based on legal counsel to try and hide behind the freedom of the press and the First Amendment to avoid prosecution.”

U.S. and Mexican agencies had been monitoring the phone lines and electronic correspondence of El Chapo’s lieutenants in the drug lord’s powerful Sinaloa Cartel, sources said. They were surveilling Del Castillo, Penn and the producers Oct. 2 as they met El Chapo’s men at a Mexican hotel before traveling by car and plane deep into the Mexican jungle.

“Based on wire intercepts, the U.S. government was aware that Sean Penn was visiting with El Chapo and even acted to protect him while they were watching him,” a high-ranking government source close to the investigation into El Chapo told FoxNews.com. “The Mexican military wanted to go in and get El Chapo, but the State Department did not want them to, because it would put Americans in danger. The State Department applied pressure to delay the siege until Penn and his crew were gone.”

Within its own ranks, federal agents supervising the effort to recapture El Chapo after his bold 2014 escape six months earlier from the Puente Grande maximum prison facility in Jalisco had another debate over whether to detain Penn when he crossed back over the border.

Federal law allows U.S. Customs and Border Protection agents to search anyone at the country’s borders for any reason and examine their luggage and electronics without a warrant, but agents usually only do so if they suspect criminal activity.

“When Sean Penn entered the U.S., there was a plan to have him border searched, but we didn’t want to tip off El Chapo that he’d been found,” the high-ranking government source told FoxNews.com. “There is an exception at the border, a long-standing legal principal held up by the courts, that anyone can be searched at the border at any time for evidence of a crime.”

Government officials ultimately held off because they could not substantiate Penn had met with El Chapo. At some point during their air transport to meet with the drug lord, the government had lost track of the group.

The Mexican military did make an attempt to capture El Chapo on Oct. 3 just after Penn, Castillo and the producers left, but El Chapo escaped.

In his Jan. 9 article, Penn detailed what happened after he left El Chapo’s compound Oct. 3, and the Mexican military and the U.S. Drug Enforcement Administration moved in.

“A source familiar with the cartel informed me on Oct. 3 that the initial siege had begun,” Penn wrote. “That source and another on the ground in Sinaloa reported that over the next several days, two military helicopters were shot down and Mexican marine ground troops laid siege to several ranch properties. There were additional reports that 13 Sinaloa communities had been ravaged with gunfire during simultaneous raids.

“By the time news agencies broadcast the story in the United States, the mayhem throughout Sinaloa in those days had been essentially reduced to a nearly successful raid that had surgically targeted only Chapo and his men, and claimed he had been injured in flight with face and leg wounds,” wrote Penn, who later called the article a "failure" because it did not ignite a national debate about the war on drugs.

El Chapo was apprehended Jan. 8, three months after his meeting with Penn and Del Castillo, in his native Sinaloa state after a shootout with the Mexican police that left six people dead.

Neither Penn, Stone nor Del Castillo returned multiple requests for comment.

FoxNews.com's Diana Falzone contributed to this report.