Two-dimensional infrared spectroscopy is capable of following the transfer of vibrational energy between modes in real time. We develop a method to include vibrational relaxation in simulations of two-dimensional infrared spectra at finite temperature. The method takes into account the correlated fluctuations that occur in the frequencies of the vibrational states and in the coupling between them as a result of interaction with the environment. The fluctuations influence the two-dimensional infrared line shape and cause vibrational relaxation during the waiting time, which is included using second-order perturbation theory. The method is demonstrated by applying it to the amide-I and amide-II modes in N-methylacetamide in heavy water. Stochastic information on the fluctuations is obtained from a molecular dynamics trajectory, which is converted to time dependent frequencies and couplings with a map from a density functional calculation. Solvent dynamics with the same frequency as the energy gap between the two amide modes lead to efficient relaxation between amide-I and amide-II on a 560 fs time scale. We show that the cross peak intensity in the two-dimensional infrared spectrum provides a good measure for the vibrational relaxation. (c) 2007 American Institute of Physics.