Towards the end of the Tang dynasty, the imperial government granted increased powers to the "jiedushi", the regional military governors. The An Lushan and Huang Chao rebellions weakened the imperial government, and by the early 10th century the "jiedushi" commanded "de facto" independence from its authority. In the last decades of the Tang dynasty, they were not even appointed by the central court any more, but developed hereditary systems, from father to son or from patron to protégé. They had their own armies rivaling the "palace armies" and amassed huge wealth, as testified by their sumptuous tombs. After the collapse of the Tang dynasty in 907, the Five Dynasties and Ten Kingdoms period thus ensued.