Applying the ab initio molecular dynamics method, we have studied the solvation and dynamics of an excess proton and a proton hole in liquid water. We find for the H3O+ ion a dynamic solvation complex which continuously fluctuates between a (H5O2)(+) and (H9O4)(+) structure as a result of proton transfer. The results of the simulation strongly suggest that the rate-limiting step for the migration of the excess proton is the concerted dynamics of the second solvation shell hydrogen bonded to the ligand H2O molecules. The OH- ion has a predominantly planar 4-fold coordination. Proton transfer is only observed when this (H9O5)(-) complex is transformed into a tetrahedral (H7O4)(-) configuration. The formation of this more open complex determines the OH- diffusion rate.