Mathematical modeling of ice sheets is complicated by the nonlinearity of the governing equations and boundary conditions. Standard grid-based methods require complex front-tracking techniques and have a limited capability to handle large material deformations and abrupt changes in bottom topography. Consequently, numerical methods are usually restricted to shallow ice-sheet and ice-shelf approximations. We propose a new smoothed-particle hydrodynamics (SPH) model for coupled ice-sheet and ice-shelf dynamics. SPH, a fully Lagrangian particle method, is highly scalable and its Lagrangian nature and meshless discretization are well suited to the simulation of free surface flows, large material deformation and material fragmentation. In this paper, we use the SPH model to study ice-sheet/ice-shelf behavior, and the dynamics of the grounding line. The steady-state position of the grounding line obtained from SPH simulations is in good agreement with laboratory observations for a wide range of simulated bedrock slopes and density ratios, similar to those of ice and sea water. The numerical accuracy of the SPH algorithm is verified by simulating the plane-shear flow of two immiscible fluids and the propagation of a highly viscous blob of fluid along a horizontal surface. In the experiment, the ice was represented with a viscous Newtonian fluid. For consistency, in the described SPH model the ice is also modeled as a viscous Newtonian fluid. Typically, ice sheets are modeled as a non-Newtonian fluid, accounting for the changes in the mechanical properties of the ice. Implementation of a non-Newtonian rheology in the SPH model is the subject of our ongoing research.