The Imperial Japanese Army (IJA) 40th Division was raised as a triangular division on 30 June 1939 in Zentsuji, Kagawa prefecture, simultaneously with 38th, 39th and 41st divisions. Its manpower came primarily from the four prefectures of Shikoku island. Although intended as a garrison force to maintain public order and to cover police duties in Japanese-occupied portions of China, due to the deteriorating situation in the Second Sino-Japanese War it was quickly assigned to front-line combat duties.
In April 1942, the 40th Division was one of the units assigned to capturing the downed American airmen of the Doolittle Mission in what came to be known as the Zhejiang-Jiangxi Campaign.
From February 1943, the 40th division has started to participate in the offensive toward Chongqing. Nonetheless, in March 1943, the 40th mountain artillery regiment was renamed as 31st mountain artillery regiment and sent to reinforce 31st Division (Imperial Japanese Army) in ill-fated Battle of Kohima. The lost regiment was never replaced.
In January 1945, the 40th Division was assigned to guard the Guangdong–Hankou Railway. During that period the divisional headquarters were in Qujiang District, Shaoguan. Afterwards, it came under the command of the Twenty-Third Army and stationed in the Guangdong-Macau area to counter anticipated landings by Allied forces. However, as American forces invaded Okinawa in April 1945, the 40th Division received orders to withdraw from Guangdong to Shanghai. En route, while in Nanchang, Jiangxi province, the war came to an end. The 40th Division's final orders were to withdraw from Nanchang to Nanjing, where it was demobilized, and its surviving troops were returned to Sasebo, Japan by May 1946.