In 1985, nearby the city of Brockton, MA (near Boston), John Bennett is a lonely child who dearly wished for his new Christmas gift, a large teddy bear named Ted, to come to life to be his friend. That wish coincided with a falling star and Ted (voiced by Seth MacFarlane) became a fully mobile sentient being. John's parents (Alex Borstein and Ralph Garman) got over the shock, word of the miracle spread and Ted was briefly a celebrity.
In 2012, John (Mark Wahlberg) and Ted (voiced and motion captured by Seth MacFarlane) are still staunch, if immature, companions enjoying a hedonistic life even while John is pursuing a 4-year-long relationship with a level-headed office worker, Lori Collins (Mila Kunis). As the fourth anniversary of their relationship approaches, Lori hopes to marry John, but she feels he can't move ahead with his life with Ted around, who has become a vulgar, obnoxious wastrel. John is resistant to making his lifelong companion leave, but he is finally persuaded that night to act when the couple discover Ted at home with four prostitutes, one of whom had defecated on the floor during a game of truth or dare.