LOS ANGELES (AP) ― Street racers couldn’t catch a time-traveling dog and his son at the multiplex last weekend.

Though Disney’s “Need for Speed” was expected to take the No. 1 position at the box office, DreamWorks’ “Mr. Peabody & Sherman” took the lead, with the action film in third place.

The animated movie, about the adventures of a genius dog and the human son he adopted, earned $21.2 million, according to studio estimates released Sunday. Debuting on March 9 at No. 2, the 3-D kiddie-jaunt features voices from “Modern Family” stars Ty Burrell and Ariel Winter.

“Our midweek numbers were very strong, indicating good and positive word of mouth,” said Chris Aronson, president of domestic distribution at Twentieth Century Fox. “If anything, this is exceeding (expectations). It’s a combination of likable characters and it’s a nostalgia play for those who are familiar with the show.”

Mr. Peabody and Sherman first appeared in the 1950s and early 1960s on “Peabody’s Improbable History,” a segment within the animated television series “Rocky and His Friends” and later “The Bullwinkle Show.”

“The family marketplace is giving every other genre a run for its money,” said Paul Dergarabedian, senior media analyst for box-office tracker Rentrak. “But the St. Patrick’s Day effect could be at play here, where families had to exercise their options at the theater rather than the pub. That may have paid off for ‘Mr. Peabody.’”

Meanwhile, analysts predicted that “Need for Speed,” based on the popular EA Entertainment video game and starring “Breaking Bad” alum Aaron Paul, would come in at No. 1 this weekend. But with $17.8 million, it arrived at No. 3 in the U.S. But the movie raced to the top of the international box office, bringing in $45.6 million.

Warner Bros.’ warrior drama “300: Rise of an Empire,” the 3-D sequel to 2007’s “300,” dropped to second place, with $19.1 million, after debuting at No. 1 on March 9. Though its opening haul of $45.1 million pales in comparison to the original, which debuted with $70.9 million, “Rise of an Empire” has earned more than $78 million since its debut.

Tyler Perry’s “The Single Moms Club,” starring Nia Long and Amy Smart, opened with $8.3 million at No. 5.

“This is one of Tyler Perry’s lowest debuts ever, but he cranks out hits every year for almost decade,” Dergarabedian said. “He’s allowed a couple of missteps every once in a while.”

Leading the year’s early trend of films about religion, Fox’s “Son of God” grossed $5.4 million in its third weekend. After opening at No. 2 with $26.5 million, it dropped to No. 5 in its second week, earning $10 million.