This ended Hasan's remarkable triple bid on the track, who has already won the 5000m. She will also run in the 10000m on Saturday after missing out on an unprecedented hat-trick of victory.
Laura Muir of Great Britain after winning the silver medal in the women's 1500 meters (Mike Egerton/PA)
The 28-year-old hit the front with Canada's Gabriella Debussy-Stafford inside the first lap with Kipyegon and Muir.
But Kipyegon took the lead early in the final lap and Muir moved to second place with 200 metres.
Muir's medal in Japan ends a series of near misses in major championships.
She dropped to seventh in the 1500m in Rio, despite being in the medal race with the 200m; The disappointment followed the 2017 World Championships where she finished fourth with 0.07 seconds.
She has since become a quadruple European indoor champion, European champion in 2018, and claimed silver at the World Indoor Championships.
Muir also came fifth at the World Championships in Doha in 2019, when she saw her preparation hampered by an Achilles problem, but eventually reached the podium at the Olympic Stadium.
An emotional Muir told the BBC: "I don't know what to say. I've worked so hard for so long.
"I have been fourth, fifth, twice, sixth and seventh in the global champions every year since 2015. I also have a silver and a British record.
"It felt like 3:54 because it was hurting - that last 100 meters I don't think I've ever been so scared that someone was going to pass me and I was about to finish fourth.
"I gave it absolutely my all and I was tying up pretty badly but I thought keep pushing."
Muir paid tribute to his coach Andy Young, saying: "I started working with him in 2011, so almost a decade the following month and he basically sacrificed four minutes there for the last 10 years. Can't thank you enough."
Earlier, the men's 4x400m relay team failed to make the final after finishing sixth in the heats.