In the nonconvex case solutions of rate-independent systems may develop jumps as a function of time. To model such jumps, we adopt the philosophy that rate independence should be considered as limit of systems with smaller and smaller viscosity. For the finite-dimensional case we study the vanishing-viscosity limit of doubly nonlinear equations given in terms of a differentiable energy functional and a dissipation potential which is a viscous regularization of a given rate-independent dissipation potential. The resulting definition of `BV solutions' involves, in a nontrivial way, both the rate-independent and the viscous dissipation potential, which play a crucial role in the description of the associated jump trajectories. We shall prove a...