Since late 2010, outbreaks of porcine epidemic diarrhea (PED) have been reported in the swine industry in China. A variant PEDV strain that differs from strain CV777 causes prevalent PEDV infections which commercial vaccines based on CV777 cannot provide complete protection. In this study, we designed a new vaccine based on the epidemic PEDV strain AH2012/12, adjuvanted with flagellin, a mucosal adjuvant that induces mucosal and systemic production of IgA. Three groups of pregnant sows were immunized twice, with a 14-day interval, with PEDV adjuvanted with flagellin, PEDV alone, or PBS before farrowing, and newborn piglets from each group were selected and challenged with PEDV. Immunization with this vaccine elicited high levels of IgG, IgA, and neutralizing antibodies in the serum and colostrum of sows, and newborn piglets were protected against PEDV while suckling. This study should guide the prevention and control strategies for PEDV infection, thereby reducing the losses associated with this virus.