The iconic Peanuts special “A Charlie Brown Christmas” turns 50 this year, which ABC marked Monday night with a musical retrospective celebrating the animated tale that has become a hallmark of the holiday TV season.

But back in 1965, the now-classic special almost didn’t air.

When Coca-Cola’s ad agency (which sponsored the original special) contacted executive producer Lee Mendelson looking for a holiday special for CBS, he pitched the idea of “A Charlie Brown Christmas” on a whim — before even mentioning it to “Peanuts” cartoonist Charles Schulz. The two then had three days to come up with a fuller proposal.

As Mendelson recalled in the documentary “The Making of ‘A Charlie Brown Christmas,'” Coca-Cola approved the outline and gave them six months to produce the special — an extremely tight deadline for an animated show, especially given that Peanuts had never been adapted for TV before.

Director Bill Melendez opted to use amateur children to voice most of the Peanuts characters which meant he often had to feed lines to the 5- and 6-year-olds, resulting in the singsong cadence of the younger characters. Schulz’s decision to have Linus read a Bible passage was also seen as risky, since a Bible verse had never been animated.

When the special was finally complete, Mendelson and Melendez thought the whole thing was too slow and didn’t work and that they had ruined Charlie Brown. CBS didn’t like it either — saying it didn’t fit with what a children’s Christmas special looked like at the time.

“The general reaction was one of some disappointment — that it didn’t really translate as well as we thought it would,” former CBS executive Fred Silverman recalls. “There were specific negative comments about the music. Some of the voicing sounded amateurish. But it was a commitment and the film was made.”

Because the special was already printed in the TV listings, the network aired it anyway on Dec. 9, 1965 — and it earned a whopping 49 audience share, meaning nearly 50 percent of TVs on that night were tuned into “A Charlie Brown Christmas.”

The special went on to receive an Emmy and a Peabody Award and is the second-longest running holiday special on TV (behind “Rudolph the Red-Nosed Reindeer”). Composer Vince Guaraldi’s jazz soundtrack has become iconic in its own right, selling more than 3.4 million copies, according to Nielsen SoundScan. It even spawned its own set of US postage stamps.

Like the lovable loser Charlie Brown, the special became a TV hero almost in spite of itself.

This article originally appeared in the New York Post.