The surface magneto-optical Kerr effect was used to study the magnetic properties of Co ultrathin films deposited on Pt(111). The easy axis of the magnetization changes from the out-of-plane to the in-plane direction after the coverage of Co is larger than 3.5 ML. The spin can reorient to the normal of the surface when the proper thickness of Ag overlayers is deposited on Co/Pt(111) with the in-plane magnetization. The out-of-plane magnetization and its coercivity as a function of Ag coverage were investigated during the spin-reorientation transition. The easy axis of the magnetization can shift back to the in-plane direction after the Ag overlayers are sputtered out. The chemical compositions of the interfaces were measured by Auger electron spectroscopy. The mechanism of the spin-reorientation transition induced by Ag is discussed.