In 206 BC, the Qin dynasty collapsed after the last Qin ruler, Ziying, surrendered to Liu Bang. Liu Bang's army occupied the Qin capital Xianyang. Upon entering the Epang Palace, Liu Bang and most of his men seized treasures and women for themselves, while Xiao He rushed to the chancellor's office and ordered it to be heavily guarded. Xiao He then brought a few men with him to collect all official documents in the office and bring them out safely. Xiao He later explained that the documents were more valuable than riches and women, because they contained crucial information about the Qin Empire and would be useful in intelligence.