The main aim of the current study is the analysis of friction stir processing (FSP) of Mg-based alloys as a possible tool for nanocomposites production. The study reports microstructural changes taking place in a Mg-based alloy (AE42) subjected to FSP under different cooling conditions. The FSP process was carried out with single as well as multipass options. The friction stir processed samples were characterized by scanning electron microscopy (SEM), energy-dispersive spectroscopy (EDS), transmission electron microscopy (TEM), focused ion beam (FIB)-scanning ion microscopy (SIM), and X-ray diffraction (XRD). It was observed that FSP tends to fragment the elongated precipitates and produces near homogeneous distribution of fine particles. The smallest particle size was observed to be produced by double-pass FSP supplemented by rapid cooling, thereby generating in situ nanocomposites. Vickers microhardness testing was done along the thickness (transverse direction) of the specimen to study and understand the variation of hardness with thickness. Nearly a two-times increase in the microhardness of AE42 was observed in the case of double-pass, FSP AE42 with cooling at temperature of approximately 253 K (-20°C). To confirm these observations, another magnesium alloy AM50 was also friction stir processed under similar conditions. The fine submicron grain structure produced in AE42 alloy contributed immensely toward grain boundary strengthening and Orowan strengthening had only marginal influence. Subgrain boundary pinning by in situ nanoparticles contributed significantly in the strengthening process.