The Rosetta spacecraft accomplished a flyby of Mars on its way to 67P/Churyumov-Gerasimenko on 25 February 2007. In this paper we describe the measurements obtained by the M channel of the Visual and Infrared Thermal Imaging Spectrometer (VIRTIS-M) and the first scientific results derived from their analysis. The broad spectral coverage of the VIRTIS-M in the IR permitted the study of various phenomena occurring in the Martian atmosphere; observations were further exploited to achieve accurate absolute radiometric calibration. Nighttime data from the VIRTIS-M constrain the air temperature profile in the lower atmosphere (5-30 km), using variations in CO2 opacity at 4.3 mm. A comparison of this data with the global circulation model (GCM) by Forget et al. (1999) shows a trend of slightly higher air temperature in the VIRTIS-M retrievals; this is accompanied by the presence of moderate decreases (∼5 K) in large sections of the equatorial region. This is potentially related to the occurrence of water ice cl uds. Daytime data from the VIRTIS-M reveal CO 2 non-local thermodynamic equilibrium emission in the high atmosphere. A mapping of emission intensity confirms its strict dependence on solar zenith angle. Additionally, devoted limb observations allowed the retrieval of vertical emission intensity profiles, indicating a peak around 105 km in southern tropical regions. Ozone content can be effectively monitored by the emission of O2 (a1Δg) at 1.27 μm. Retrieved emission intensity shows that polar regions are particularly rich in ozone. Aerosol scattering was observed in the 1-2.5 μm region above the night region above the night disk, suggesting the occurrence of very high noctilucent clouds.