The 31-year-old, who had never previously won a medal at a major championships and one of four Germans in the final, launched the javelin a world leading 67.
69 metres with her sixth effort.
“I cannot really believe this,” she said. “After my fifth throw, I thought, ‘Maybe I can still improve a little bit’. I dreamed about that and now I have this new PB and world lead. Perfect.”
“This is a first class feeling now. I still cannot believe it. I am so happy. This is fantastic! I have always dreamed about a medal, no matter the colour.”
Molitor’s final throw relegated China’s Lyu Huihui, who had led the way after an Asian record 66.13m with her fifth throw, to the silver medal position.
Lyu was nevertheless delighted with her first major medal and paid tribute to the noisy crowd at thee Bird’s Nest Stadium.
“I am very excited about this silver medal, I was able to come back and to come back strong,” said the 26-year-old.
“We had set a goal to do well here. The crowd here gave me wonderful support, they shouted “jia you” (go, go) for me and this helped me a lot.”
South Africa’s Sunette Viljoen, who had owned the previous best throw of the year, collected a second world bronze after her 2011 podium finish with 66.13m.
“This event is unpredictable and it is beautiful,” she said. “It was a very special performance from the Chinese girl. And Katharina, wow, nobody expected that.
“I love what I do, I love the javelin and it is such a privilege to stand on the podium.”
Czech Olympic and former world champion Barbora Spotakova managed only 60.08m with her third throw and failed to get through to the last three rounds.
(Reporting by Nick Mulvenney, editing by Ed Osmond/Mitch Phillips)