We studied the Aa geomagnetic index (aa index daily average) behavior on a monthly timescale using data from 1868 to 2015 for cycles 11-24. We identified solar-and lunar-associated periodicities in the Aa time series and found statistically significant Aa minima values a few days before the full Moon and high Aa values during the new Moon. When considering all the cycles, it was clear that the deepest Aa minima occurred during the Aa descending activity phase. However, when the cycles were separated according to the direction of the interplanetary magnetic field (IMF), the Aa minima came from the contribution of cycles with the IMF pointing toward the Sun (Type 1). Furthermore, during the descending phase of cycles with the IMF pointing away from the Sun (Type 2), the smallest Aa index values were found along with smaller changes compared to Type 1 cases. This behavior implies that during Type 1 cycles there are larger Aa perturbations than during Type 2 cycles. It is very likely that the mechanisms responsible for the Aa monthly behavior are a combination of solar and lunar effects that depend on several factors: (a) the Moon phases (new and full Moon), (b) the phase of the solar cycle (ascending or descending), and (c) the direction of the interplanetary magnetic field (away or toward the Sun).