With the development of lead-free solders in the electronic packing industry, Sn–Ag–Cu solders are one of the most promising lead-free alloys to be applied due to their outstanding mechanical property and wettability. By performing indentation experiments, the effect of cooling rate on the mechanical properties of Sn–3.0Ag–0.5Cu (SAC305) solder is investigated in typical cooling conditions (i.e., furnace cooled and water quenched) and compared with the as-machined samples of bulk solder bars from the industry. Based on continuous stiffness measurement technique, Young’s modulus and hardness are reduced by 2.3–3.9GPa and 0.053–0.085GPa, respectively, after annealing treatment for the indentation depth between 1000nm and 1100nm in samples after cooling, however, the value of hardness is independent of cooling condition. By defining the contact stiffness to represent residual stress in solder samples after cooling and annealing process, an exponential-based Oliver–Pharr model is employed to fit the unloading responses of indentation. It is found that the smaller cooling rate induces less contact stiffness and thus less residual stress. Despite different cooling conditions, the contact stiffness of unannealed and annealed solder samples are 711.8–842.5μN/nm and 655.2–673.4μN/nm, respectively. Thus, annealing treatment of 210∘C for 6h can effectively alleviate residual stress to a similar level for SAC305 solder samples with different cooling conditions. This conclusion is supported by the alleviation of pile-up deformation in the residual indentation after annealing treatment.