James Bond was in Afghanistan on Sunday, but he wasn’t on some secret spy mission – Daniel Craig, who portrays the 007 in the newly released film “Skyfall,” paid a surprise visit to British troops stationed in the war-torn country.

Craig made a surprise visit to Afghanistan at the end of a weekend that saw the greatly anticipated “Skyfall” fall to No. 2 at the box office behind the highly awaited “Twilight: Breaking Dawn Part II.”

The English actor, 44, viewed the latest Bond flick with some 800 British soldiers at Camp Bastion in Helmand Province before giving a brief speech, Reuters reported.

Craig’s itinerary also included a tour of Camp Bastion and witnessing soldier training at the camp, which is used to train combatants who are later deployed to forward operating bases, the U.K. Ministry of Defence told Reuters.

"It was really good morale for everyone - it's a decent thing for him to take time to come out and visit everyone here," Private Scott Craggs, a medical technician, said.

Craig also participated in some activities more closely linked to his role as 007, although it wasn’t as subtle as the clandestine secret agent; the actor fired off machine guns during his visit. The Afghanistan surprise trip also included meeting with trauma patients at a Camp Bastion hospital.

“Skyfall,” the third Bond film starring Craig, opened Nov. 9 to rave reviews and opened No. 1 at the box office. The movie has a 92 percent fresh rating on Rotten Tomatoes.

“[Director] Sam Mendes brings Bond surging back with a smart, sexy, riveting action thriller that qualifies as one of the best 007 films to date,” read the consensus opinion on the movie rating website.

Audiences agreed, with 89 percent saying they enjoyed the latest Bond film.

The movie pulled in $41.5 million over the weekend, bringing the film’s total gross to more than $161 million, according to boxofficemojo.com.

“Breaking Dawn Part II” was the top draw -- raking in more than $141 million from “Twilight” fans -- who were eagerly awaiting the latest and last film of the vampire series.