 Eunuchs were the only males outside the royal family allowed to stay inside the palace overnight.Court records going back to 1392 indicate that the average lifespan of eunuchs was 70.0 ± 1.76 years, which was 14.4–19.1 years longer than the lifespan of non-castrated men of similar socio-economic status.The Vietnamese adopted the eunuch system and castration techniques from China.