The effects of solar flares on the upper atmosphere of Mars are large but poorly constrained by observations. These effects are an important aspect of the response of Mars to space weather events and may also influence the escape of volatiles from Mars, particularly in the solar system's early history. Here we report the effects of the X8.2 flare on 10 September 2017 on the density and composition of the thermosphere of Mars. This analysis uses neutral number densities of He, O, N 2 , CO, Ar, and CO 2 from the MAVEN Neutral Gas and Ion Mass Spectrometer (NGIMS). From these observations, we investigate how the enhanced solar irradiance during the flare produced changes in the neutral upper atmosphere of Mars due to atmospheric heating and photochemistry. Flare-produced photochemical changes in the neutral thermosphere of Mars have been previously implied but not quantified. We find that at fixed altitudes, the number densities of all species barring He increase and the O/CO 2 ratio decreases by ∼15-45%, indicating thermal expansion. However, when viewed at fixed total number densities, the densities of CO 2 and Ar decrease, and the O/CO 2 ratio increases by up to a factor of ∼3. The photodissociation of CO 2 is one photochemical process that produces changes resembling those identified. The quantified changes will help to constrain the shifting chemical makeup of the upper atmosphere due to these impactful flare events and may aid modeling of flare behavior and the impact of flares on the evolution of the Martian climate.