Including gravity and wettability effects, a full analytical solution for the frontal flow period for 1D counter-current spontaneous imbibition of a wetting phase into a porous medium saturated initially with non-wetting phase at initial wetting phase saturation is presented. The analytical solution applicable for liquid-liquid and liquid-gas systems is essentially valid for the cases when the gravity forces are relatively large and before the wetting phase front hits the no-flow boundary in the capillary-dominated regime. The new analytical solution free of any arbitrary parameters can also be utilized for predicting non-wetting phase recovery by spontaneous imbibition. In addition, a new dimensionless time equation for predicting dimensionless distances travelled by the wetting phase front versus dimensionless time is presented. Dimensionless distance travelled by the waterfront versus time was calculated varying the non-wetting phase viscosity between 1 and 100 mPas. The new dimensionless time expression was able to perfectly scale all these calculated dimensionless distance versus time responses into one single curve confirming the ability for the new scaling equation to properly account for variations in non-wetting phase viscosities. The dimensionless stabilization time, defined as the time at which the capillary forces are balanced by the gravity forces, was calculated to be approximately 0.6. The full analytical solution was finally used to derive a new transfer function with application to dual-porosity simulation. 123 50 A. Mirzaei-Paiaman et al. Abbreviations ρ (= ρ w − ρ o ) Density difference between the water and the oil phase (kg · m −3 ) ∞ Infinite time (s) − S Spatial average normalized water saturation 1D One dimensional A(t), B(t) Functions of time a, b, z Exponents COUCSI Counter-current spontaneous imbibition eEuler's number (2.718282…) gAcceleration due to gravity vertically in downward direction(m · s −2 )Derivative of the dimensionless capillary pressure function with respect to water saturation J (S w ) Dimensionless capillary pressure function K Permeability (m 2 ) K ro Endpoint oil relative permeability K rw Endpoint water relative permeability L Length (m) N Recovery (m 3 ) N p