 Neither the origins , ethnic makeup , nor early history of the Khitans are well documented in historical records . The earliest reference to a Khitan state is found in the Book of Wei , a history of the Northern Wei Dynasty ( 386 – 534 ) that was completed in 554 . Several books written after 554 mention the Khitans as being active during the late third and early fourth centuries . The Book of Jin ( 648 ) , a history of the Jin dynasty ( 265 – 420 ) , refers to the Khitans in the section covering the reign of <unk> Sheng ( 398 – 401 ) . Samguk Sagi ( 1145 ) , a history of the Three Kingdoms of Korea , mentions a Khitan raid taking place in 378 . 
