The invention relates to an ionic liquid based method for extracting lignin by a two-liquid-phase system, comprising the following steps of: 1, preparing a mixed solution of 40%-80% of imidazole salt ionic liquid and 20%-60% of organic solvents, and adding 0.5%-2% of deionized watert; 2, adding the mixed solution, a lignin-containing solid plant material or a plant material ramification into a reaction kettle, conducting oil bath for 0.5-3 hours under 403-443 K and 0.1-10 MPa, and then obtaining filter liquor and a filter cake; 3, adding 4-6 multiplied deionized water into the filter liquor, and separating rough lignin out; 4, purifying by a soxhlet extraction method, wherein the organic solvents are ethylacetate, dioxane and ethanol or methanol. The invention obtains lignin products, andreaction residuals can still be continuously used in slurrying process of the paper manufacturing industry; in addition, the invention has the advantages of high extraction rate of the lignin, solvent recycling, easy operation and low cost.