The effect of sample size on fluid saturation during capillary invasion is determined by modeling the invasion process on three-dimensional cubic networks consisting of pore throats with radii randomly selected from various pore size distributions. Without buoyancy, the threshold saturation of the nonwetting fluid when it completes a connected path across a sample decreases with the square root of sample size for all the pore size distributions studied. Experiments on Berea sandstone samples ranging from 0.3 to 30 cm in size confirm the 1/root L scaling relation. The 1/root L scaling is the prediction of percolation theory without buoyancy. Large-aspect-ratio [(height):(diameter)] samples have greater threshold nonwetting phase saturations than low-aspect-ratio samples. Relative permeability, which is dependent on the largest interconnected pores, also depends on sample size and shape. The pore size distribution affects the pore occupancy when buoyancy is important. To describe this effect we introduce a measure of the skewness of the pore size distribution into the Bond number (the Bond number B is the ratio of buoyancy to capillary pressures). For all the cases examined, a universal scaling law for the threshold saturation has been found based on the ratio of sample size L to Bond number correlation length xi(B). xi(B) is proportional to B--0.47. This scaling relation incorporates the effects of fluid density contrast, pore size distribution, surface tension, and contact angle while retaining the basic Bond number scaling previously predicted for percolation on lattices with uniform (flat) pore size distributions. The height of the critical pore that must be filled to achieve breakthrough of the nonwetting phase is a useful parameter that also scales with L/xi(B) These finite-size scaling results have important implications for models of oil migration to reservoirs and models of pollutant migration in-ground water.