The interplanetary magnetic field (IMF) is the magnetic field of the Sun stretched out by the solar wind. The polarity of the IMF is either positive or negative according to the polarity of the original solar magnetic field. The equivalent ionospheric Disturbance Polar current powered by the azimuthal Y component current system is located at polar latitudes and provides specific geomagnetic variations. It is known that the configuration of this system depends on the polarity of the IMF. Thus, in the absence of direct data in the presatellite era, the IMF sector structure could only be inferred from ground-based geomagnetic observations (Svalgaard,1968; Mansurov,1969). In this paper the IMF polarities have been reconstructed for the nineteenth century for the first time. It is possible due to the advent of the digitized geomagnetic records in the Helsinki and St. Petersburg observatories. These data have been available since 1844 and 1878, respectively. We assume that the reconstructions are reliable enough to study the solar magnetic field of the past. The polarities inferred for the nineteenth and twentieth centuries display similar sector structures. Seasonal variations of the ratio of positive and negative sectors give clear evidence of solar magnetic field reversals starting from the second half of the nineteenth century.