LOS ANGELES — “Lone Survivor” triumphed at the weekend box office.

The patriotic Navy SEAL drama starring Mark Wahlberg, Taylor Kitsch, Emile Hirsch and Ben Foster smashed expectations to earn $38.5 million domestically in its first weekend in wide release, according to studio estimates Sunday.

The Universal film directed by “Friday Night Lights” and “Battleship” filmmaker Peter Berg is based on Marcus Luttrell’s memoir about a dangerous mission his Navy SEAL team embarked on in Afghanistan in 2005.

“We’re thrilled for us, the filmmakers and Marcus, who – as brave as a man as he is – continues to be brave in telling this true story,” said Nikki Rocco, head of distribution for Universal. “It’s an amazing result. What’s most gratifying about this is that it’s been endorsed by every quadrant of the movie-going audience: young, old, male, female.”

Rocco said “Lone Survivor” performed particularly well in middle America. The movie’s launch marks the second biggest opening for a film in January, after the $40.1 million debut of the monster movie “Cloverfield” in 2008.

“We had an inkling it’d do well when it opened in limited release in December, but projections had it coming in between $17 million to $28 million,” said Paul Dergarabedian, senior media analyst for box-office tracker Rentrak. “Nothing had it coming close to $40 million.”

In its eighth weekend, Disney’s icy animated tale “Frozen” stayed cool in the No. 2 spot, earning $15 million and bringing its domestic total to $317 million. “Frozen” also topped the international box office with $27.8 million from 50 international markets.