We simulate two-phase flow in a porous medium, which is represented by random, isotropic two- and three-dimensional networks containing up to 80 000 interconnected pore spaces. The simulations are sufficiently large that macroscopic properties of the flow may be determined. For unstable viscous floods, we show that the displacements are compact with a fractal interface between the fluids. The fractal dimension is found as a function of viscosity ratio. For invasion percolation, where the displacement is controlled by capillary forces, and for viscous fingering, we calculate relative permeabilities in an averaged two-phase Darcy equation, which we show are functions of mean saturation. The relative permeabilities also depend on flow rate, which means that the two-phase Darcy equation is nonlinear, even with microscopic linear Poiseuille flow. © 1990 The American Physical Society.