Context. There are several edge-on galaxies with a known magnetic field structure in their halo. A vertical magnetic field significantly enhances the cosmic-ray transport from the disk into the halo. This could explain the existence of the observed radio halos. Aims. We observed NGC 253 that possesses one of the brightest radio halos discovered so far. Since this galaxy is not exactly edge-on (i = 78◦) the disk magnetic field has to be modeled and subtracted from the observations in order to study the magnetic field in the halo. Methods. We used radio continuum polarimetry with the VLA in D-configuration and the Effelsberg 100-m telescope. NGC253 has a very bright nuclear point-like source, so that we had to correct for instrumental polarization. We used appropriate Effelsberg beam patterns and developed a tailored polarization calibration to cope with the off-axis location of the nucleus in the VLA primary beams. Observations at λλ6.2 cm and 3.6 cm were combined to calculate the RM distribution and to correct for Faraday rotation. Results. The large-scale magnetic field consists of a disk (r, φ) and a halo (r, z) component. The disk component can be described as an axisymmetric spiral field pointing inwards with a pitch angle of 25◦ ± 5◦ which is symmetric with respect to the plane (even parity). This field dominates in the disk, so that the observed magnetic field orientation is disk parallel at small distances from the midplane. The halo field shows a prominent X-shape centered on the nucleus similar to that of other edge-on galaxies. We propose a model where the halo field lines are along a cone with an opening angle of 90◦ ± 30◦ and are pointing away from the disk in both the northern and southern halo (even parity). We can not exclude that the field points inwards in the northern halo (odd parity). The X-shaped halo field follows the lobes seen in Hα and soft X-ray emission. Conclusions. Dynamo action and a disk wind can explain the X-shaped halo field. The nuclear starburst-driven superwind may further amplify and align the halo field by compression of the lobes of the expanding superbubbles. The disk wind is a promising candidate for the origin of the gas in the halo and for the expulsion of small-scale helical fields as requested for efficient dynamo action.