One of the biggest surprises in store for moviegoers this summer won’t be found in the last few seconds of Inception. The real revelation is that Mark Wahlberg is seriously funny, a fact audiences will come to realize when his hilarious new film, The Other Guys, hits theaters this week.

“If you come from a different background, doing serious films, and you try to do a broad comedy and it’s not funny, you’re probably not going to get the chance to do it again,” Wahlberg says of his decision to dive into the comedy fray with two of the strongest talents working in the genre today.

The movie co-stars Will Ferrell and was directed and written by Adam McKay, who also helmed Ferrell’s earlier opuses, Anchorman, Talladega Nights and Step Brothers. Considering Ferrell and McKay’s relationship dates back to the beginning of their tenure at “Saturday Night Live” in 1995, has grown to include co-founding and has birthed some of Ferrell’s most beloved roles, Wahlberg easily could have taken a backseat and let them handle the comedic pyrotechnics. But rather than play the patsy and let them have all the fun, the actor exploits his brooding tough guy image, perfected with roles such as his Oscar-nominated turn in The Departed, and turns in a side-splittingly funny performance that’s neck-and-neck with Ferrell’s.

“It was really just about letting go, being fearless, not being afraid to look ridiculous and have people laugh at you instead of with you,” the actor explains. “Coming from the background I come from, you can be a little self-conscious. It’s OK to be cool, but it’s not OK to be corny. That’s something I’ve dealt with over the years as an actor; not worrying what people think.”

He says the most important parts of the equation were finding a script that suited him – in this case one McKay wrote specifically with Wahlberg and Ferrell in mind – and a group of collaborators who were like-minded.

“This set was so loose and relaxed. On most sets I’ve worked on, it’s always kind of fun, but then it’s time to get serious. Usually I’ll take the fun too far, and the director will come over (whispering), ‘Hey, calm down, we’ve got to shoot this. Let’s get serious for a minute.’ That never happened on this movie. They let me go nuts and then they’d encourage me to go even further, to the point where I’d get to my trailer at the end of the day and I’d be exhausted with laughter.”

As the only member of the cast with demonstrable cinema cop experience, Wahlberg also had the pleasure of knowing he was on solid footing, firmly inside his wheelhouse.

“I certainly felt very comfortable when it came to anything cop-ish or action-y, but I basically just wanted to follow their lead when it came to anything [comedic]. I did whatever they told me. I’d learn the lines, show up and say the lines and if they wanted me to try anything else, I would —”

In the middle of downplaying his comic abilities, his co-star Michael Keaton, who got his big break alongside legendary Jim Belushi in the short-lived comedy series “Working Stiffs” and knows a hell of a lot about what constitutes “funny,” can’t help but interject.

“I have to jump in and say something here,” Keaton blurts. “[Mark] is ridiculously funny. We’d all go, ‘Who the fuck knew this was in this guy?’ He does voices and impressions. I was knocked out. When you look at him, he seems nice enough, but he’s ridiculously funny.”

When Wahlberg demurs, shaking his head and seeming to blush a bit, McKay speaks up as well.

“[Mark’s] got such great instincts, when he points it towards comedy, it’s such a pleasure to watch.”

Wahlberg does not, however, need any help looking like a badass. McKay laughs when he recalls Wahlberg’s nonchalance at the action portions of their buddy cop flick.

“We’d be shooting a big action scene,” McKays says, “and Will and I were like, ‘Wow! Look at this! We’re breaking a window,’ and Mark would come over, almost yawning, and be like, ‘Yeah, yeah, we did this one time except I was being shot out of a canon and I was on fire.’”

The Other Guys releases in theaters Aug. 6.