To investigate the role of the ribosomal exit tunnel on protein folding, we simulate the initial-stage folding behavior of the protein villin headpiece subdomain HP35 (PDB id: 1yrf) with and without prefolding in the exit tunnel by using an all-atom model and find that prefolding in the exit tunnel could effectively help the protein form native secondary structures. Furthermore, our results show that, after releasing from the exit tunnel, the prefolded chains may have a tendency to form more native contacts than those only in free space and this reduces the conformational space of sampling. Our results may provide an alternative way to explain the fast folding mechanism of proteins in vivo.