We present a numerical analysis of fluid flow through a porous medium with two distinct characteristic scales. The system considered is a monodisperse matrix with porosity phi and permeability K-pm with an embedded second phase, characterized by a phase content or saturation s and phase length scales L-phi and L-s. Both two- and three-dimensional simulations are performed to compute the mobile fluid phase relative permeability k(r,m) and its dependence on s and K-pm. The relative permeability is found to vary as a power law of saturation, with a quasilinear behavior for low permeability, and increasing values of the exponent as K-pm increases. For media with low permeability, the linearity of k(r,m) is attributed to the drag force, whereas for high K-pm, the decrease of k(r,m) with s is due primarily to viscous forces. An analytical model for k(r,m) is also presented to aid the interpretation and to corroborate the simulation results. In the second part, in order to elucidate the role of the length scales on k(r,m), simulations explicitly resolving both porous media and second-phase scales are performed. The relative permeability is found to drop rapidly when both scales are of the same order (L-s approximate to L-phi) or when L-s < L-phi. Three regimes (Darcy, Brinkman, Stokes) are consequently identified based on the length scales. (C) 2006 American Institute of Physics.