Yu Xuanji was born in Chang'an, the capital of the Tang Dynasty (618-907). From a very young age, Yu was tutored by her father to recite poetry and write articles. Yu was forced to marry an official named Li Yi and act as his concubine, or less wife. Their relationship degenerated to the point where Li jilted Yu and she became a courtesan.
Yu Xuanji is considered to be the most famous female poet during the Tang Dynasty. A volume of her poetry was published during her lifetime.