We establish the existence and uniqueness of pathwise strong solutions to the stochastic 3D primitive equations with only horizontal viscosity and diffusivity driven by transport noise on a cylindrical domain M = (−h, 0) × G, G ⊂ R 2 bounded and smooth, with the physical Dirichlet boundary conditions on the lateral part of the boundary. Compared to the deterministic case where the uniqueness of z-weak solutions holds in L 2 , more regular initial data are necessary to establish uniqueness in the anisotropic space H 1 z L 2 xy so that the existence of local pathwise solutions can be deduced from the Gyöngy-Krylov theorem. Global existence is established using the logarithmic Sobolev embedding, the stochastic Gronwall lemma and an iterated stopping time argument.