Electron densities in planetary ionospheres increase substantially during solar flares in response to the increased solar irradiance at soft X-ray and extreme ultraviolet wavelengths. Here we modify an existing model ofthe ionosphere of Mars to incorporate time-dependent solar irradiances and use it to simulate ionospheric conditions during the X14.4 and M7.8 solar flares of 15 and 26 April 2001, respectively. Simulations were validated by comparison to Mars Global Surveyor radio occultation measurements of vertical profiles of ionospheric electron density. Adjustments to the model’s representation of the neutral atmosphere were required to adequately reproduce the observations before and during these solar flares. Simulated enhancements in the electron density are largest and persist the longest in the M1 region. We predict that the peak electron density in the M1 region can exceed that of the M2 region for short periods during intense solar flares.