Planetary magnetic fields can affect ionospheric plasma transport and coupling with the solar wind. In contrast to the terrestrial global magnetic field, there are only weaker and sporadic crustal magnetic fields on Mars. Many studies have indicated that Martian crustal fields can still modulate the topside ionosphere and its coupling with the solar wind. Nevertheless, it is unclear whether the crustal fields can affect the ionospheric main peak, which does not directly interact with the solar wind and is dominated by photochemical processes. In this study, the crustal field effect was identified from ionospheric measurements over unevenly distributed crustal fields. Both the intensity and configuration of the crustal fields were found to be capable of affecting the ionospheric main peak. The ionospheric peak electron density tends to decrease in the strong horizontal crustal field region. The results suggest that the crustal fields may affect the ionospheric main peak through modulating solar wind energetic particle precipitation; strong horizontal magnetic fields can partially prevent energetic particle precipitation and thus weaken impact ionization.