When Robert Kennedy was shot in Los Angeles on June 5, 1968 at age 42, a new children’s show featuring homemade puppets and a cardboard castle titled “Mister Rogers’ Neighborhood” had been on the air for just four months.

“Mister Rogers’ Neighborhood” creator, Fred Rogers, was, like countless Americans, troubled by what he witnessed on the news. But he also wondered how children across the country were coping with the violence.

On June 6, Rogers worked through the night to develop a special episode for parents. The half-hour show was taped the following day and aired on public television that evening, the day before Kennedy’s funeral.

Maxwell King, author of the upcoming Rogers biography “The Good Neighbor” and former executive director of the Fred Rogers Center for Early Learning and Children’s Media, recently spoke about the episode to Smithsonian Magazine.

“This new children’s TV figure was suddenly talking to the whole family,” said King. “Rogers wasn’t just a soft-spoken newbie giving puppet shows for kids. He was a very serious thinker about the impact of media on children.”

Just several years prior, Kennedy’s brother, President John F. Kennedy, was assassinated in Texas on November 22, 1963 at age 46. And two months before Robert's death, activist and minister Dr. Martin Luther King was also fatally shot on April 4, 1968 at age 39.

VINTAGE HOLLYWOOD FLASHBACK: THE GOLDEN GLOBES IN THE '50S, '60S AND '70S

On June 6, 1958, Rogers made it a point to speak out on the air.

“I plead for your protection and support of your young children,” said a young Rogers to audiences. “There is just so much that a very young child can take.”

Rogers was always determined to offer positive programming for children. Rogers, who had already been accepted at a divinity school, got a job at NBC where he worked his way up from assistant producer to floor management. A show he created, “The Children’s Corner,” won an award in 1955.

Rogers kept busy earning graduate degrees in theology and child development. He was also ordained as a Presbyterian minister in 1963. And it didn't take long for “Mister Rogers’ Neighborhood” to be up and running.

Rogers was hoping the new program would be a welcoming alternative to slapstick comedy and other lackluster shows for children.

And for more than 30 years, Rogers promised each viewer, “You’ve made this day a special day, but just your being you.”

Kennedy’s death wouldn’t be the last time Rogers addressed a public tragedy. After the terrorist attacks of September 11, 2001, he taped a public service announcement for “those of you who grew up with us."

“I’m so grateful to you for helping the children in your life to know that you’ll do everything you can to keep them safe and to help them express their feelings in ways that will bring healing in many different neighborhoods,” he said.

Rogers died in 2003 at age 74 from stomach cancer.