We report bulk superconductivity induced by an isovalent doping of phosphorus in BaFe2(As1−xPx)2. The P-for-As substitution results in shrinkage of lattice, especially for the FeAs block layers. The resistivity anomaly associated with the spin-density-wave (SDW) transition in the undoped compound is gradually suppressed by the P doping. Superconductivity with the maximum Tc of 30 K emerges at x=0.32, coinciding with a magnetic quantum critical point (QCP) which is evidenced by the disappearance of SDW order and the linear temperature-dependent resistivity in the normal state. The Tc values were found to decrease with further P doping, and no superconductivity was observed down to 2 K for x≥ 0.77. The appearance of superconductivity in the vicinity of QCP hints to the superconductivity mechanism in iron-based arsenides.