Piper nigrum is extensively utilized because of its antioxidation, antiallergic, antitumor, antiinflammatory, antidiarrhea, and gastrointestinal protection. We attempted to indicate whether the Piper nigrum extract (PNE) could alleviate ovalbumin (OVA)-induced food allergy, and to explore its potential mechanism. An OVA-induced food allergy mouse model was established, and different concentrations of PNE were administrated. Symptoms of food allergy, levels of immunoglobulin E (IgE), mucosal mast cell protease-1 (mMCP-1), and intestine pathological changes were assessed. Additionally, the expressions of T helper (Th) 2, Th17 and regulatory T (Treg)-associated cytokines and the proportion of Th17 and Treg cells in CD4+ T cells were measured. We found PNE attenuated symptoms of food allergy and decreased the levels of IgE and mMCP-1. In PNE group, the infiltration degree of inflammatory cells was ameliorated and the villi of small intestine were more complete. Moreover, the expressions of Th2 and Th17 cell-associated cytokines were down-regulated by PNE pretreatment, while the levels of Treg cell-associated cytokines were up-regulated. PNE decreased the number of Th17 cells, while increased the Tregs cells. PNE treatment dose-dependently improved the Th17/Treg balance. PNE plays a protective role in OVA-induced food allergy through inhibiting Th2 cell response and regulating the Th17/Treg balance.