The pressure-and indentation-induced phase transformations in crystalline ͑cd͒ and amorphous ͑a͒ silicon are studied by using molecular dynamics simulations based on the modified Tersoff potential. The sp 3 s à tight-binding scheme is employed to gain insight into the origin of the change in conductivity during nanoindentation. The Gibbs free energy calculations predict the following pressure-induced phase transitions: cd-Si → -tin Si͑-Si͒ ͑11.4 GPa͒; cd-Si→ high density amorphous phase ͑HDA͒ ͑22.5 GPa͒; a-Si→ -Si ͑2.5 GPa͒; a-Si→ HDA ͑8.4 GPa͒. Simulations of nanoindentation of crystalline silicon reveal discontinuities in the load-displacement curves. In the loading curves of the cd-Si ͑100͒ substrate, the pop-in is assigned to the appearance of the -tin Si phase. During unloading, the pop-out is due to the formation of a low-density amorphous phase a-Si. The a-Si→ HDA transformation takes place during nanoindentation of a-Si in loading regime. Upon unloading the a-Si phase is preserved. The structural transformations in cd-Si and a-Si during nanoindentation are treated in terms of triaxial and uniaxial compressions of the respective bulk samples. A change in conductivity from semiconducting to metallic during nanoindentation of the cd-Si ͑100͒ and a-Si slabs is explained in terms of a transformation of the localized electronic states in the band gap region. The results are compared to those of available theoretical models and experiments.