With proper profiles of the scalar potential and the dilaton field, for the first time, the spontaneous chiral symmetry breaking in the vacuum and its restoration at finite temperature are correctly realized in the holographic QCD framework. In the chiral limit, a nonzero chiral condensate develops in the vacuum and decreases with temperature, and the phase transition is of the second order for a two-flavor case and of the first order for a three-flavor case. In the case of explicit chiral symmetry breaking, in the two-flavor case, the second-order phase transition turns into a crossover with any nonzero current quark mass, and in the three-flavor case, the first-order phase transition turns into a crossover at a finite current quark mass. The correct description of chiral symmetry breaking and restoration makes the holographic QCD models more powerful in dealing with nonperturbative QCD phenomena. This framework can be regarded as a general setup in an application of AdS/CFT to describe conventional Ginzburg-Landau-Wilson–type phase transitions, e.g. in condensed matter and cosmology systems.