The purpose of this study was to investigate the effect of Ghrelin on the polarization of microglia/ macrophages after cerebral ischemia (CI) in rats. 60 wild-type SD rats were randomly divided into sham group, CI group, CI+Ghrelin group, 20 rats in each group. The modified Longa suture method was used to establish the middle cerebral artery occlusion (MCAO) model in rats. Before surgery, Ghrelin was injected subcutaneously (100μg/kg, twice a day) for 4 consecutive weeks. After modeling, neurological function scores were performed with three behavioral experiments: mNSS score, Corner test, and Rotarod test, to evaluate the recovery of neurological function after Ghrelin treatment. At the same time, the brain tissues were collected and stained with 2,3,5-triphenyltetrazolium chloride (TTC) to detect the cerebral infarct volume. RT-qPCR was used to detect the expression of TNF-α and IL-1β in the ischemic brain tissue, and the TUNEL staining was used to detect the apoptosis of brain tissue. Flow cytometry was used to detect the percentage of M1 type microglia/macrophages which were isolated by trypsin digestion of fresh cerebral cortex. Then, the Western blotting and immunofluorescence method were used to detect the phosphorylation level of AKT (P-AKT) and AKT. Compared with the CI group, the neurological function of the rats in the CI+Ghrelin group was dramatically improved, and the cerebral infarction area was dramatically reduced. At the same time, the expression of TNF-α and IL-1β in the ischemic brain tissue of rats in the CI+Ghrelin group decreased, and the apoptotic cells in the brain tissue also decreased. Compared with the CI treatment group, the activation of M1 microglia/macrophages in the cortex of the ischemic side of the infarct and the peri-infarct area in the CI+Ghrelin group was dramatically inhibited. At the same time, the ratio of P-AKT/AKT of the brain tissue in the CI+Ghrelin group was dramatically higher than that of the CI group. In the rat cerebral ischemia model, Ghrelin can promote the repair of brain damage and the recovery of neurological function after ischemia. Its mechanism may be related to activating AKT to selectively reduce M1 microglia/macrophages, reducing inflammation and cell apoptosis in brain tissue.