Experiments in various porous media have shown that multiple parameters come into play when an oleic phase is displaced by an aqueous solution of surfactant. In general, the displacement efficiency is improved when the fluids become quasi-miscible. Understanding the phase behavior oil/water/surfactant systems is important because microemulsion has the ability to generate ultralow interfacial tension (<10(-2) mN m(-1)) that is required for miscibility to occur. Many studies focus on microemulsion formation and the resulting properties under equilibrium conditions. However, the majority of applications where microemulsion is present also involve flow, which has received relatively less attention. It is commonly assumed that the characteristics of an oil/water/surfactant system under flowing conditions are identical to the one under equilibrium conditions. Here, we show that this is not necessarily the case. We studied the equilibrium phase behavior of a model system consisting of n-decane and an aqueous solution of olefin sulfonate surfactant, which has practical applications for enhanced oil recovery. The salt content of the aqueous solution was varied to provide a range of different microemulsion compositions and oil-water interfacial tensions. We then performed microfluidic flow experiments to study the dynamic in situ formation of microemulsion by coinjecting bulk fluids of n-decane and surfactant solution into a T-junction capillary geometry. A solvatochromatic fluorescent dye was used to obtain spatially resolved compositional information. In this way, we visualized the microemulsion formation and the flow of it along with the excess phases. A complex interaction between the flow patterns and the microemulsion properties was observed. The formation of microemulsion influenced the flow regimes, and the flow regimes affected the characteristics of the microemulsion formation. In particular, at low flow rates, slug flow was observed, which had profound consequences on the pore scale mixing behavior and resulting microemulsion properties.