An electrochemical reaction within nanopores is remarkably decelerated once a diffusion-limited condition is reached due to the difficulty in supply of reactants from the bulk. Here, we report a powerful method of overcoming this problem for electrochemical deposition of platinum within nanopores formed on silicon. We made the pore wall surface of the silicon electrode hydrophobic by covering it with organic molecules and adopted platinum complex ions with sufficiently large sizes. Such ions, which are only weakly hydrated, are excluded from the bulk aqueous electrolyte solution to the surface and rather hydrophobic in this sense. When the ion concentration in the bulk was gradually increased, at a threshold the deposition behavior exhibited a sudden change, leading to drastic acceleration of the electrochemical deposition. Using our statistical-mechanical theory for confined molecular liquids, we show that this change originates from a surface-induced phase transition: The space within nanopores is abruptly filled with the second phase within which the ion concentration is orders of magnitude higher. When the affinity of the surface with water was gradually reduced with fixing the ion concentration, qualitatively the same transition phenomenon was observed, which can also be elucidated by our theory. The utilization of the surface-induced phase transition sheds new light on the design and control of a chemical reaction in nanospace.