A dynamic two-phase flow model for proton exchange membrane fuel cells is presented. The two-dimensional model includes the two-phase flow of water (gaseous and liquid) in the gas diffusion layers (GDLs) and in the catalyst layers (CLs), as well as the transport of the species in the gas phase. The membrane model describes water transport in a perfluorinated-sulfonic-acid-ionomer-based membrane. Two transport modes of water in the membrane are considered, and appropriate coupling conditions to the porous CLs are formulated. Water transport through the membrane in the vapor equilibrated transport mode is described by a Grotthus mechanism, which is included as a macroscopic diffusion process. The driving force for water transport in the liquid equilibrated mode is due to a gradient in the hydraulic water pressure. Moreover, electro-osmotic drag of water is accounted for. The discretization of the resulting flow equations is done by a mixed finite element approach. Based on this method, the transport equations for the species in each phase are discretized by a finite volume scheme. The coupled mixed finite element/finite volume approach gives the spatially resolved water and gas saturation and the species concentrations. In order to describe the charge transport in the fuel cell, the Poisson equations for the electrons and protons are solved by using Galerkin finite element schemes. The electrochemical reactions in the catalyst layer are modeled with a simple Tafel approach via source/sink terms in the Poisson equations and in the mass balance equations. Heat transport is modeled in the GDLs, the CLs, and the membrane. Heat transport through the solid, liquid, and gas phases is included in the GDLs and the CLs. Heat transport in the membrane is described in the solid and liquid phases. Both heat conduction and heat convection are included in the model.