The first-passage time of a Markov process to a moving barrier is considered as a first-exit time for a vector whose components include the process and the barrier. Thus when the barrier is itself a solution of a differential equation, the theory of first-exit times for multidimensional processes may be used to obtain differential equations for the moments and density of the first-passage time of the process to the barrier. The procedure is first illustrated for first-passage-time problems where the solutions are known. The mean first-passage time of an Ornstein–Uhlenbeck process to an exponentially decaying barrier is then found by numerical solution of a partial differential equation. Extensions of the method to problems involving Markov processes with discontinuous sample paths and to cases where the process is confined between two moving barriers are also discussed.