Jake Gyllenhaal managed to dupe a few cops into thinking he was part of the force on the set of his upcoming film, “End of Watch,” in which he portrays an LAPD officer.

The 31-year-old actor, who took on five months of training and shaved his head for the role, was apparently so convincing with his insider lingo, his director, David Ayer, said a bonafide street team couldn’t tell the difference.

In an interview with Yahoo! News, the filmmaker, who also wrote the cop movie “Training Day,” described the reality-style setup that led to the deception.

“The movie’s ‘found footage’ shooting style required the camera crew to stay out of sight,” Ayer said. Thus, Gyllenhaal and actor Michael Peña, his partner in the film, performed their scenes unexposed.

“There were times where Jake and Mike are in uniform in a marked police vehicle, and there were no cameras to indicate a movie was being filmed.”

Accordingly, the actors appeared to be policemen on the clock, and Gyllenhaal took advantage of the disguise.

Ayer explained, “Cops in L.A. will do a hand sign with four fingers to say ‘everything’s good.’ Jake threw a ‘code four’ at some LAPD cops rolling by and they threw a ‘Code Four’ back. I don’t think they had any idea it was Jake Gyllenhaal!”

Shot on the streets of Los Angeles over five weeks, the film, opening in theaters Sept. 28, is the story of two young police officers who get in over their heads with a drug cartel. The film is inspired by true stories from a former LAPD gang officer. According to Yahoo!, Ayer said the cartel in the movie is his creation based on actual crime rings.

“There is a lot of cartel activity in the U.S., and Los Angeles especially because we’re close to the border,” noted the director. “It is not uncommon for LAPD officers in South L.A. to run into cartel-affiliated people.”

The first trailer for the film was released through Yahoo! on May 3, and from the looks of it, there’s a lot of shooting, a lot of banging down doors, and a very brutal murder that leads to trouble. In an interview with E! Online in August, Gyllenhaal and Ayer detailed the actor’s training regimen more specifically, noting the prep worked involved, “ride-a-longs, “tactical training and fight training” nearly every day.

Gyllenhaal told E!, “My goal for this is to not have any of that stuff [Hollywood] in the mix. Ironically when you show up in a police uniform in a police car, people don’t tend to recognize you. It is, in a way, like a batsuit. It has that effect.”

The LAPD might agree.