Since Mars does not possess a significant global intrinsic magnetic field, the solar wind interacts directly with the Martian ionosphere and can induce ion escapes from it. Phobos-2 and recent Mars Express (MEX) observations have shown that the escaping ions are O+ as well as molecular O2+ and CO2+. While O+ escape can be understood by the ion pick-up of non-thermal O corona extended around the planet, regarding the heavy molecular O2+ and CO2+, which are buried in the lower ionosphere, a novel escape mechanism needs to considered. Here we attack this problem by global magnetohydrodynamic (MHD) simulations. First, we clarify the global structure of the streamlines that result from the interaction with the solar wind. Then, by focusing on the streamlines that dip into the low-altitude part of the dayside ionosphere, we investigate the escape path of the molecular ions. The effects of the interplanetary magnetic field (IMF) on the molecular ion escape process are investigated by comparing the results with and without IMF. IMF has little effect on O+ escape via ion pick-up mediated by solar wind electron impact ionization of the O corona. O2+ and CO2+ are shoveled from the low-altitude regions of the dayside ionosphere by magnetic tension in the presence of IMF. These ions are pulled by the U-shaped field lines to the north and south poles, and at the terminator, they are concentrated in the noon–midnight meridian plane. These ions remain confined to the noon–midnight plane as they are transported to the nightside to form the tail ray. Then they escape along the streamlines open to the interplanetary space. Under a typical solar wind and IMF condition expected at Mars, O+, O2+ and CO2+ escape fluxes are 8.0 × 1023, 3.5 × 1023 and 5.0 × 1022 ion s−1, respectively, which are in good agreement with the MEX observations