Through symbolic computation with Maple, a class of lump solutions, rationally localized in all directions in the space, to the (2+1)-dimensional Kadomtsev-Petviashvili (KP) equation is presented, making use of its Hirota bilinear form. The resulting lump solutions contain six free parameters, two of which are due to the translation invariance of the KP equation and the other four of which satisfy a non-zero determinant condition guaranteeing analyticity and rational localization of the solutions. Three contour plots with different determinant values are sequentially made to show that the corresponding lump solution tends to zero when the determinant approaches zero. Two particular lump solutions with specific values of the involved parameters are plotted, as illustrative examples. (C) 2015 Elsevier B.V. All rights reserved.