After King Gongmin of Goryeo marries the Yuan princess Noguk, they return to Goryeo. On the way, they are attacked and the queen is fatally injured. According to the advice of his royal advisor, the king orders royal bodyguard Choi Young to pass through a mystical portal (“heaven’s gate”) and find the “heaven’s doctor”. Choi Young travels to the future and brings back Yoo Eun-soo, a modern-day doctor from Seoul, who saves the queen’s life. He makes a promise that he will return her to her world, but the scheming royal advisor persuades King Gongmin to force Eun-soo to stay as she can be useful to him.
As Eun-soo accustoms herself to her new surroundings, gradually she and Choi Young fall in love with each other. But problems arise as others become fascinated with her as the “Heaven’s doctor”, and Eun-soo becomes a pawn in the political power plays between King Gongmin, the Yuan overlords, the sociopathic nobleman Ki-chul and Prince Deok-seung, King Gongmin’s uncle. Constantly risking his life, Choi Young thwarts numerous attempts by Ki-chul and Deok-seung to kidnap and possess Eun-soo, which almost resulted in the death of the king and queen.
Choi Young brings Eun-soo to the portal before it closes so that she can travel back and bid farewell to her loved ones and join Choi Young permanently. Ki-chul attacked them and Choi Young suffers a life-threatening wound. Ki-chul then drags Eun-soo to the portal, and Eun-Soo enters it hoping to save him by gathering medical supplies from the future. When she passes through the portal again, she finds herself in an era a hundred years before Choi Young’s time. There, she spends a few years waiting for the portal to open again, while leaving hints for her future self. One day, “heaven’s gate” opens again and Eun-soo enters, only to find herself again back in modern-day Seoul. She re-enters the portal and travels to the time period five years after she left Choi Young, a time during which he has brilliantly won a number of military battles and reclaimed lands of Goryeo. Finally, she and Choi Young reunite.