It is difficult to obtain an accurate mathematical model in electro-hydraulic servo control system, due to the nonlinear factors such as dead zone, saturation, flow coefficient, and friction. Hence, a parameter identification algorithm, combining recursive least squares (RLS) with modified nonlinear particle swarm optimization (NPSO) algorithm, is proposed. On this basis, another improved NPSO algorithm is also put forward, aiming at searching for the optimal proportional–integral (PI) controller gain of the nonlinear hydraulic system while giving comprehensive consideration to the system performance indexes. The system identification experiments and position tracking control are conducted, respectively. As indicated by the comparison with the least squares (LS), RLS, PSO, and RLS–LPSO results, the proposed method shows higher identification and control accuracy.