Brian, Stewie

[Warning: This article contains spoilers from Sunday's episode of Family Guy. Read at your own risk!]

The Griffins got the best Christmas present ever on Sunday's episode of Family Guy, when beloved dog Brian — who was hit by a car and killed in an episode that aired last month — was brought back from the dead.

Though the episode opened with Brian's replacement, Vinnie, still included in the opening credits, an uncharacteristically emotional Stewie later told a mall Santa that his biggest wish for Christmas was to have Brian back.

Photos: The most shocking TV deaths

Vinnie dresses up as Brian to try to cheer his new owner up, but when that doesn't work, he takes him to the mall to pick out something else. While there, Vinnie sees Past Stewie, who still has the time machine Stewie was using in the episode where Brian was killed. Vinnie and Stewie hatch a plan to use the time machine to go back in time and save Brian before he was hit by a car.

The resurrected Brian thanks Stewie, saying "a lot of other families would have just gotten another dog and moved on." Ha.

Fans of the Seth MacFarlane cartoon were outraged when the show appeared to have killed Brian off, and had even started a petition to bring the character back to life. But apparently the entire arc was part of a well thought-out plan, according to MacFarlane.

Fans start petition to resurrect Brian on Family Guy

"And thus endeth our warm, fuzzy holiday lesson: Never take those you love for granted, for they can be gone in a flash," MacFarlane tweeted after the episode airs.

He later added: "I mean, you didn't really think we'd kill off Brian, did you? Jesus, we'd have to be f---ing high. ... Oh and hey... thanks for caring so much about the canine Griffin. He is overcome with gratitude."

Are you happy Brian is back on Family Guy?