Wahlberg's character grew up with Ted, a highly inappropriate teddy bear voiced by Seth MacFarlane.
In second place was "Magic Mike" with $39.2 million.
It was followed by Disney-Pixar's "Brave," which took in $34 million.
The top 10 films of the weekend were:
1. "Ted," $54.1 million.
2. "Magic Mike," $39.2 million.
3. "Brave," $34 million ($6.7 million international).
4. "Tyler Perry's Madea's Witness Protection," $26.4 million.
5. "Madagascar 3: Europe's Most Wanted," $11.8 million ($16.2 million international).
6. "Abraham Lincoln: Vampire Hunter," $6 million ($5 million international).
7. "Prometheus," $4.93 million ($6.2 million international).
8. "Moonrise Kingdom," $4.9 million ($375,000 international).
9. "Snow White & the Huntsman," $4.4 million ($14.5 million international).
10. "People Like Us," $4.3 million.
The Associated Press contributed to this report.