In 1985, 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 became a fully mobile sentient being. John's parents got over the shock, word of the miracle spread and Ted was briefly a celebrity.
In 2012, John and Ted are still staunch, if immature, companions enjoying a hedonistic life even while John is in a relationship with office worker Lori Collins. As their fourth anniversary approaches, Lori hopes to marry John, but feels he cannot move ahead with his life with Ted around. John is resistant to making his lifelong companion leave, but is finally persuaded 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.
John finds Ted his own apartment and a job at a grocery store, where he meets coworker Tami-Lynn, has sexual intercourse with her on top of the produce they sell to the public, and gets promoted for doing so. Regardless, John and Ted still spend most of their time together, which frustrates Lori when she discovers John has been skipping work to do so while using her for his excuses. Things start to come to a head when John and Lori are invited to a party put on by Lori's womanizing manager Rex and Ted lures John away to a party at his apartment with the offer to meet Sam J. Jones, the star of their favorite film Flash Gordon. Although John arrives with the intention of spending only a few minutes, he gets caught up in the occasion, which goes completely out of control. Lori discovers John there and breaks up with him on the spot, in tears. At that point, an angered John blames Ted for ruining his life and tells him to stay away.
Eventually, John and Ted confront each other about their ruined friendship and manage to reconcile after a violent brawl in John's hotel room. To repair John's relationship with Lori, Ted arranges with an old lover, singer Norah Jones, to help by having John express his love for Lori with a song during her concert. Although John's performance proves an embarrassment, Lori is touched by the attempt and returns to her apartment after being angered by Rex's sneering of him. Ted comes clean to Lori about his role in John's relapse and offers to leave them alone forever if she can talk to him. Lori is persuaded, but moments after she leaves, Ted is kidnapped by Donny, a crazed stalker who idolized Ted as a child. Donny plans to make Ted the toy of his brutishly destructive son Robert.
Ted distracts Robert and reaches a phone to contact John, but is soon recaptured. Realizing that Ted is in danger, John and Lori find Donny's residence and chase him and Robert to rescue Ted. The chase leads to Fenway Park, where John knocks out Robert, but during the chase Ted is damaged and falls onto the field torn completely in half. A police car arrives, forcing Donny to flee. As John and Lori gather his stuffing, Ted relays his wish that John be happy with Lori, as the magic that gives him life fades away.
Unable to accept Ted's death, a depressed John and Lori return to her apartment to repair Ted, but it proves useless. That night, Lori feels guilty about her part in the incident, so she quietly makes a wish on a falling star. The next morning, John sits down on the couch and hangs his head while looking over Ted's dead body. Fortunately, Ted is magically restored and after he tricks John into thinking he is retarded, he and Lori fully reconcile with Ted, who encourages them to resume their relationship.
With that resolution, John and Lori are married (with Sam Jones as the presiding minister) and Ted comfortably accepts having a life of his own, Ted and Tami-Lynn continued their torrid love affair for quite some time. One afternoon Ted was caught behind the deli counter eating potato salad off of Tami-Lynn's bare bottom. He was instantly promoted to store manager. Sam Jones attempts to restart his career and moves into a studio apartment with Brandon Routh. Rex gives up his pursuit of Lori, goes into a deep depression, and dies of Lou Gehrig's disease. Donny gets arrested by the Boston Police Department for kidnapping a plush toy, but the charges are eventually dropped because they sound too stupid. Robert hires a personal trainer, loses a significant amount of weight and goes on to become Taylor Lautner.