Google helped the filmmakers reconstruct the company's campus for filming at Georgia Tech in Atlanta, down to the details such as the T-shirts employees wear and the colorful "Noogler" propeller hats that interns wear during their first week. Google's creative team designed the movie's end credits. Google even contributed dialogue for two scenes.

The film comes as Google's do-no-evil corporate image is under scrutiny from government regulators and privacy watchdogs, who question whether the technology giant's business practices harm consumers and competitors.

"If the movie can convey a spirit of openness and fairness, of connecting the world and doing no evil, then it is going to be very positive for Google's image," said Peter Sealey, adjunct professor of marketing at Claremont Graduate University. "Google needs that now. This movie could help keep them out of the penalty box a little while longer."

Vaughn, who first approached Google, and director Shawn Levy insist that "The Internship," which opens June 7, is not a two-hour commercial for the technology giant. Google did have approval over how its products and culture were represented in the film, but it did not have final cut. The company gave filmmakers only notes about technical details in the movie, Levy said, and Google did not contribute to "The Internship's" $58-million budget.

Wheeler Winston Dixon, a film studies professor at the University of Nebraska-Lincoln, called "The Internship" an "epic piece of branding" for Google. "To have an entire film tent-poled around one company takes product placement to a whole new level," he said.

"The Internship" continues a warming of ties between Google and Hollywood after years in which the two have clashed over piracy issues; Fox was the last major studio to agree to distribute its movies through Google Play. The relationship has begun to evolve from mutual suspicion to mutual interest, and building a film around a company that has become a fixture in popular culture may help the studio sell tickets.

"I do believe there is an increasing recognition of how to coexist and, in fact, help each other," said Levy.

Google executives cast their motivations in much simpler terms. The film, they say, is a way to encourage kids to fall in love with math and science and pursue careers in technology.

"The reason we got involved with the movie 'The Internship' is that computer science has a marketing problem," Google Chief Executive Larry Page said during a keynote speech last week at the company's annual developers' conference in San Francisco. "We're the nerdy curmudgeons."

Vaughn came up with concept for the comedy when the recession hit and friends in the Midwest began losing their jobs. As he began sketching out the story, he hit on the idea of having two salesmen reinvent themselves at the company that has come to symbolize the new economy.

"If you were to start over, that would be the great place to go," Vaughn said. After completing a draft of the script, he requested a meeting with Google in April 2011.

"We're quite used to the phone ringing and people asking to work with us," Google Chief Marketing Officer Lorraine Twohill said. "We do a lot of creative collaboration. But this is clearly a whole different scale."

Vaughn and Wilson toured Google's headquarters and laid out the premise for "The Internship." The notion that Google, which hires 1,500 summer interns from a pool of 40,000-plus highly qualified candidates, would give a shot to two goofy washouts broke the ice.

"We all started laughing," Twohill recalled.

Films about companies don't always work out the way their image handlers might hope. Producer Scott Rudin approached Facebook about participating in the 2010 film "The Social Network" but said he walked away because the company made too many creative demands. The movie won three Oscars, but Facebook founder Mark Zuckerberg was portrayed in an unflattering light.