Previous studies have shown that seawater may alter the wettability in the direction of more water-wet conditions in carbonate reservoirs. The reason for this is that ions from the salt (sulphat, magnesium, calsium, etc) can create a wettability alteration toward more water-wet conditions as salt is absorbed on the rock. In order to initiate a more systematic study of this phenomenon a 1-D mathematical model relevant for spontaneous imbibition is formulated. The model represents a core plug on laboratory scale where a general wettability alteration (WA) agent is included. Relative permeability and capillary pressure curves are obtained via interpolation between two sets of curves corresponding to oil-wet and water-wet conditions. This interpolation depends on the adsorption isotherm in such a way that when no adsorption of the WA agent has taken place, oil-wet conditions prevail. However, as the adsorption of this agent takes place, gradually there is a shift towards more water-wet conditions. Hence, the basic mechanism that adsorption of the WA agent is responsible for the wettability alteration, is naturally captured by the model. Conservation of mass of oil, water, and the WA agent, combined with Darcy's law, yield a 2x2 system of coupled parabolic convection-diffusion equations, one equation for the water phase and another for the concentration of the WA agent. The model describes the interactions between gravity and capillarity when initial oil-wet core experiences a wettability alteration towards more water-wet conditions due to the spreading of the WA agent by molecular diffusion. Basic properties of the model are studied by considering a discrete version. Numerical computations are performed to explore the role of molecular diffusion of the WA agent into the core plug, the balance between gravity and capillary forces, and dynamic wettability alteration versus permanent wetting states. In particular, a new and characteristic oil-bank is observed. This is due to incorporation of dynamic wettability alteration and cannot be seen for case with permanent wetting characteristics. More precisely, the phenomenon is caused by a cross-diffusion term appearing in capillary diffusion term.