Using the only admissible rank-two realisations of the Lie algebra of the affine group in one dimension in terms of the Lie algebra of Lie symmetries of the Ermakov-Pinney (EP) equation, some classes of second order nonlinear ordinary differential equations solvable by reduction method are constructed. One class includes the standard EP equation as a special case. A new EP equation with a perturbed potential but admitting the same solution formula as EP itself arises. The solution of the dissipative EP equation is also discussed. (C) 2020 Elsevier Ltd. All rights reserved.