At the time of the attack on Pearl Harbor, Ayanami was assigned to Destroyer Division 19 of Desron 3 of the IJN 1st Fleet, and had deployed from Kure Naval District to the port of Samah on Hainan Island, escorting Japanese troopships for landing operations in the Battle of Malaya.