  A longstanding open question in classical mechanics is to formulate the least
action principle for dissipative systems. In this work, we give a general
formulation of this principle by considering a whole conservative system
including the damped moving body and its environment receiving the dissipated
energy. This composite system has the conservative Hamiltonian $H=K_1+V_1+H_2$
where $K_1$ is the kinetic energy of the moving body, $V_1$ its potential
energy and $H_2$ the energy of the environment. The Lagrangian can be derived
by using the usual Legendre transformation $L=2K_1+2K_2-H$ where $K_2$ is the
total kinetic energy of the environment. An equivalent expression of this
Lagrangian is $L=K_1-V_1-E_d$ where $E_d$ is the energy dissipated by the
friction from the moving body into the environment from the beginning of the
motion. The usual variation calculus of least action leads to the correct
equation of the damped motion. We also show that this general formulation is a
natural consequence of the virtual work principle.
