The work presented in this paper is motivated by a specific failure mode known as lateral wire buckling occurring in the tensile armor layers of flexible pipes. The tensile armor is usually constituted by two layers of initially helically wound steel wires with opposite lay directions. During pipe laying in ultra deep waters, a flexible pipe experiences repeated bending cycles and longitudinal compression. These loading conditions are known to impose a danger to the structural integrity of the armoring layers, if the compressive load on the pipe exceeds the total maximum compressive load carrying ability of the wires. This may cause the wires to buckle in the circumferential pipe direction, when these are restrained against radial deformations by adjacent layers. In the present paper, a single armoring wire modeled as a long and slender curved beam embedded in a frictionless cylinder bent into a toroid will be studied in order to gain further understanding of this failure mode. In order to study the compressive behavior, both perfect beams as well as beams with small geometrical imperfections are studied. The mathematical formulation of the problem is based on curved beam equilibrium and allows large deflections to be taken into calculation.