While Bardem praised Depp as "a joy to work with," he admitted that the actor's familiarity with his iconic role was captivating, and it was sometimes hard for co-stars not to get caught up in his performance.
"He's playing this character he knows so well that sometimes, the difficult part is to not be a spectator," the 48-year-old star recounted. "Sometimes I was shooting with him and I was watching how he became Sparrow and it was a delight. And then it's like, 'S**t! I have to say my line.'"
Bardem explained how he also looked for advice on working with the stalwart Pirates star by turning to his wife, Penelope Cruz, who starred opposite Depp in the fourth Pirates film, On Stranger Tides.
"[Her] advice for working with Johnny is very simple, it's 'have fun,'" Bardem shared.
"When I was on the Pirates 4 set, while Penelope was shooting, I realized how amazing the team was [that] Jerry Bruckheimer and Disney put together to make this kind of movie," he continued. "I knew from the very beginning it was going to be an easy and exciting process."
In Dead Men Tell No Tales, Bardem stars as Captain Armando Salazar, a magical, maniacal undead pirate hunter who seeks the Trident of Poseidon so he can kill every pirate who sails the seas and get revenge on his nemesis, Jack Sparrow.
Many familiar faces will be returning for the fifth Pirates film. Aside from Depp, Geoffrey Rush returns for a fifth time as Captain Hector Barbossa, while Keira Knightley will reprise her role as Elizabeth Turner.
Orlando Bloom is also returning as Will Turner, Elizabeth's husband who became the Captain of the Flying Dutchman at the end of the third film, At World's End.
Meanwhile, Bardem is currently working alongside his wife on the upcoming drama Escobar, which tells the real life story of drug lord Pablo Escobar's romantic entanglement with Colombian journalist Virginia Vallejo.
Bardem plays as the eponymous cocaine kingpin opposite Cruz, who stars as Vallejo.
The actor opened up to ET about how his working relationship with his wife has evolved after co-starring on a number of other projects over the years, including 2013's The Counselor and 2008's Vicky Christina Barcelona.
"[Our connection] was very powerful in the sense that the relationship of those two characters, Virginia and Pablo, is very powerful," Bardem shared. "We had a great time doing it together… But there were some tough scenes in it."