Nanoindentation and nanoscratching of an indium phosphide (InP) semiconductor surface was investigated via contact mechanics. Plastic deformation in InP is known to be caused by the nucleation, propagation, and multiplication of dislocations. Using selective electrochemical dissolution, which reveals dislocations at the semiconductor surface, the load needed to create the first dislocations in indentation and scratching can be determined. The experimental results showed that the load threshold to generate the first dislocations is twice lower in scratching compared to indentation. By modeling the elastic stress fields using contact mechanics based on Hertz’s theory, the results during scratching can be related to the friction between the surface and the tip. Moreover, Hertz’s model suggests that dislocations nucleate firstly at the surface and then propagate inside the bulk. The dislocation nucleation process explains the pop-in event which is characterized by a sudden extension of the indenter inside the surface during loading.