A novel Lagrangian type of MHD code has been developed by treating elements of the fluid as finite-sized particles. The particle quantities, i.e., position, mass, momentum and temperature, are pushed in a Lagrangian way, while the magnetic fields are advanced in an Eulerian manner. The fully Lagrangian fluid is represented by a distribution of Gaussian-shaped particles. Drag forces between particles with different velocities in the same cell prevent extensive mufti-streaming from developing. A combination of finite differences, to calculate the magnetic field, and fast Fourier transforms, to evaluate the pressure gradient term, guarantees momentum and magnetic flux conservation. The use of particles eliminates many difficulties often associated with Eulerian codes such as, for example; negative densities. The method also means that any particle code of which there are many can be converted to a fluid code. The codes have been extensively tested with the propagation of sound waves, Alfven and magnetosonic waves among others. Applications of the codes to hydrodynamics and magnetohydrodynamics in one, two and three dimensions, in cartesian as well as in toroidal geometry, are further discussed. © 1979.