The pressure-induced phase transition in GaAs is studied using an ab initio constant-pressure relaxation simulation. GaAs undergoes a first-order phase transition to Cmcm at 54 GPa. Upon further increase of pressure a gradual phase change to Imm2 structure is seen at 57 GPa, which confirms an earlier experiment and clears some doubts about the existence and identity of Imm2. The transition pressures are also calculated from the Gibbs free energy, and it is found that the structural phase change occurs at 23.5 GPa for Cmcm and at 24 GPa for Imm2. The transformation path from Cmcm and Imm2 proceeds through sliding of some Cmcm planes and relatively large sliding yields a transition from Imm2 to simple hexagonal structure. We find that Cmcm and Imm2 phases are semimetals.