Long-term metformin treatment reduces the risk of stroke. However, the effective administration pattern and indications of metformin on acute cerebral ischemia are unclear. To investigate the neuroprotective treatment duration and dosage of metformin on focal ischemia mice and the association of neuroprotection with 5'-adenosine monophosphate-activated protein kinase (AMPK) regulations, male C57BL/6 mice were subjected to permanent or transient middle cerebral artery occlusion (MCAO) and metformin of 3, 10 and 30 mg/kg was intraperitoneally injected 1, 3 or 7 days prior to MCAO, or at the onset, or 1, 3 or 6 h after reperfusion, respectively. Infarct volumes, neurological deficit score, cell apoptosis, both total and phosphorylated AMPK expressions were assessed. Results showed that prolonged pretreatment to 7 days of metformin (10 mg/kg) significantly ameliorated brain infarct, neurological scores and cell apoptosis in permanent MCAO mice. Shorter (3 days or 1 day) or without pretreatment of metformin was not effective, suggesting a pretreatment time window. In transient MCAO mice, metformin showed no neuroprotection even with pretreatment. The expressions of total and phosphorylated AMPK were sharply decreased with effective metformin pretreatments in ischemic brains. Our data provided the first evidence that in acute ischemic injury, a 7-days pretreatment duration of 10 mg/kg metformin is necessary for its neuroprotection, and metformin may not be beneficial in the cases of blood reperfusion.