An omnipresent, nine-month marketing campaign[1] propelled "The Angry Birds Movie[2]" to No. 1 at the North American box office over the weekend, giving Sony Pictures an important feather for its frayed cap.

"Angry Birds," based on a 2009 mobile game that became a pop-culture craze[3], sold an estimated $39 million in tickets, on the high end of prerelease analyst expectations. The PG-rated movie, which received mediocre reviews, has generated an additional $111 million overseas. "Taking a video game and bringing it to life as a film brand is a very difficult thing to do, and we're thrilled to have launched a new franchise," Josh Greenstein, Sony's president of worldwide marketing and distribution, said by phone on Sunday.

Most of the "Angry Birds" financial risk fell to Rovio, the Finnish video game company, which paid $173 million to make and market the movie. As such, Rovio will receive the bulk of any profit. Sony, working hard to move beyond a prolonged box-office rough patch, distributed "Angry Birds" in return for a 7 percent slice of ticket sales.

"Captain America: Civil War[4]" (Disney) fell to second place, taking in about $33.1 million, for a three-week domestic total of $347.4 million, according to comScore, which compiles box-office data. "Civil War" has collected an additional $706.1 million overseas.

Despite receiving good reviews[5], "Neighbors 2: Sorority Rising[6]" (Universal) fizzled in third place, collecting an estimated $21.8 million, or 55 percent less than its series predecessor generated upon its 2014 arrival. Comedy sequels often falter, although the R-rated "Sorority Rising," which cost about $35 million to make, seemed ready to break that curse. For whatev er reason — the story line, a crowded marketplace — fans did not buy in.

Similarly disappointing was "The Nice Guys[7]" (Warner Bros.), an action comedy set in the 1970s that cost a reported $50 million[8] to make. Starring Ryan Gosling and Russell Crowe[9], "The Nice Guys" took in $11.3 million. Funding for the film was raised by the producer Joel Silver; Warner then bought domestic distribution rights.