The invention relates to a hydraulic centering cylinder with a mechanical lockup function and belongs to the field of automobile steering systems. The hydraulic centering cylinder comprises an oil cylinder body, a
piston rod, a left oil cylinder end cover, a right oil cylinder end cover, a left floating
piston, a right floating
piston, a spring, lockup pistons and nuts. The installation method of the hydraulic centering cylinder includes that the spring is strung in axis through holes of the two lockup pistons which are vertically and symmetrically arranged, then the integrated spring and lockup pistons are placed in a groove of an annular boss of the
piston rod, and finally, two ends of the spring are tensioned by the nuts to finish assembling. By means of extension and retraction of the two lockup pistons, integration and separation of the
piston rod and a cylinder body through relative movement are achieved, and accordingly, mechanical lockup and unlocking of the
piston rod during movement are achieved. By means of mechanical lockup, slight moving of the piston rod under large impacting is prevented, and simultaneously, safety guarantee is provided for hydraulic centering. When unlocking is required, only working
oil pressure is required to be removed, and the lockup pistons are automatically retracted to the groove of the annular boss of the piston rod to finish unlocking under the action of spring forces.