The invention relates to a waterfroof agent used in cement mortar and a preparation method thereof. The waterfroof agent comprises the following raw materials of: by weight, 5.0-15.0 parts of paraffin, 3.0-5.0 parts of silicone oil, 0.5-3.0 parts of aliphatic acid, 1.0-3.0 parts of triethanolamine, 0.4-2.5 parts of sodium hydroxide and 60.0-100.0 parts of deionized water. The preparation method comprises the following steps of: firstly respectively weighing the above raw materials, mixing, melting, heating, saponifying, cooling, homogenizing, examining, and packaging to obtain a milky thick liquid waterfroof agent. The waterproof agent is aqueous and environmentally friendly, is nontoxic and tasteless, causes no pollution, is convenient to use, and has good compatibility with cement mortar. With the addition of the waterproof agent, cured and dried cement mortar has a strong waterproof function and can effectively avoid entry of rainwater, thus guaranteeing construction quality and service life.