Returning to China in 1939, Li became Associate Professor of Law at the National Wuhan University, at the time relocated to Leshan, Sichuan due to the Second Sino-Japanese War.
Following the end of the Chinese Civil War in 1949, Li moved to Beijing, where he served the Communist government as an Expert Commissioner to the National Law Commission of China up to 1956.
From 1963 to 1993, Li was concurrently Professor of International Law at Peking University and Legal Advisor to the Ministry of Foreign Affairs of the People's Republic of China (PRC).
Li Haopei translated a number of works from English, German, and French, including the Napoleonic code.
In the same period, Li served as Judge at the Appeals Chamber at the International Criminal Tribunal for the Former Yugoslavia.