Molly Shannon’s comedic characters came from grief.

“Superstar” Mary Katherine Gallagher, the beloved “Saturday Night Live” character, was inspired by Shannon’s experience after her mom, younger sister and cousin were killed in a car accident when she was 4-years-old.

In her new memoir, Hello, Molly!, the star detailed how she dealt with grief.

“I’m a lot like Mary Katherine Gallagher. I’m a survivor,” she writes, as per People.

In 1969, her dad had been drinking and drove the family home when he sideswiped a car before driving into a steel pole. Shannon’s mom, sister Katie, 3, and cousin, Fran, all died. Shannon, her dad and sister Mary, 6, survived.

READ MORE: First Look At Showtime Comedy ‘I Love That For You’, Starring Vanessa Bayer, Jennifer Lewis & Molly Shannon

“The car was mangled badly on impact. A man passing the scene stopped. My mother was lying on the ground beside our car and she asked him, ‘Where are my girls?’ ” Shannon writes. “She wanted to gather her three little girls and she couldn’t. Her heart must have broken in that moment. And those were her final words.”

Shannon remembered wanting to see her mom in the hospital but a family member had to tell her that she was dead. “I didn’t know what death was. I just wondered, ‘Why did Mommy and Katie leave without me? Maybe I’m bad.'”

Being raised by a single father, Shannon built “character”– “It gave me so much freedom later as a performer.”

Once in university, Shannon first started Mary Katherine Gallagher while studying drama.

“I was doing the character as a very nervous person — an exaggerated version of myself and how I felt,” she recalled. “Mary Katherine wants to be a star and she wants to be seen and she wants her mom to come back from the dead.”

READ MORE: Molly Shannon Meets The NYC Couple Who Returned Her Lost Phone

“The character is a survivor… an adult child of an alcoholic. A girl who trips. But gets back up. It’s an emotional character. I wrote from my heart.”

“Saturday Night Live” airs Saturdays at 11:29 p.m. ET on Global.

Hello, Molly is out on April 12.