Many animals in nature experience hydrodynamic benefits by swimming near the ground. Inspired by near-ground swimmers, a flexible fin flapping near the ground was modeled in a two-dimensional Cartesian coordinate system. The transverse heaving motion was prescribed at the leading edge and the posterior part of the fin fluttered passively under the fin-fluid interaction. The fin freely moved horizontally in a quiescent flow, which dynamically determined the swimming speed. The fluid- flexible fin interaction was considered by using an immersed boundary method. The fin could swim up to 14% faster near the ground than in the bulk fluid, and the vortices in the wake moved away from the ground. The body kinematics was passively altered by flapping near the ground, and the trailing edge amplitude decreased as the ground proximity increased. The benefits or penalties in the thrust and the power input by swimming near the ground were not only the direct results of the hydrodynamic changes, but also the indirect results of the altered body kinematics. The thrust was enhanced by approximately 37% and the power input increased by about 17% at the ground proximity of 1.5, which were the pure results of the hydrodynamic changes near the ground. The flexible fin could generate more thrust near the ground with a smaller penalty in the power input, leading to the enhancement of the Froude propulsive efficiency by about 17%. Published by AIP Publishing.