it had been the seat of emperors for twelve thousand years and , before that , the capital of one of the most important pre-imperial kingdoms , which had , little by little , captured or otherwise absorbed the other kingdoms to establish the empire .