The effective method of ionic liquid-based aqueous two-phase extraction, which involves ionic liquid (IL) (1-butyl-3-methyllimidazolium chloride, [C4mim]Cl) and inorganic salt (K2HPO4) coupled with high-performance liquid chromatography (HPLC), has been used to extract trace tilmicosin in real water samples which were passed through a 0.45 μm filter. The effects of the different types of salts, the concentration of K2HPO4 and of ILs, the pH value and temperature of the systems on the extraction efficiencies have all been investigated. Under the optimum conditions, the average extraction efficiency is up to 95.8%. This method was feasible when applied to the analysis of tilmicosin in real water samples within the range 0.5–40 μg mL−1. The limit of detection was found to be 0.05 μg mL−1. The recovery rate of tilmicosin was 92.0–99.0% from the real water samples by the proposed method. This process is suggested to have important applications for the extraction of tilmicosin.