Submarine pipeline has been utilized more and more widely in offshore oil and gas transportation engineering. Given that these pipelines frequently subject horizontal loading during operation, thus precise predicting their horizontal bearing capacity is essential. However, most previous studies employ deterministic analysis without considering soil spatialvariability. This article introduces a two-dimensional (2D) random finite element analysis to study the horizontal pullout behaviour and failure mechanisms of a pipeline in a spatial variability soil. It is observed that the effect of soil spatial variability on the horizontal bearing capacity factor and failure mechanisms is remarkably substantial, with the distribution of the former showing a close approximation to a log-normal distribution. Furthermore, the average horizontal bearing capacity typically falls below the corresponding deterministic value. Consequently, the deterministic estimation of the horizontal bearing capacity tends to be inflated. Eventually, a reliability-based approach is formulated, where a factor of safety is incorporated to account for the uncertainties arising from spatial variability and ensure a sufficient safety margin. This methodology enables engineers to determine appropriate factor of safety tailored to the specific requirements of each project.