During 1917 the 3rd Division operated in the Ypres sector in Belgium, with the battalion taking part in the battle at Messines in June, Warneton in late July, Broodseinde in early October, and then at Passchendaele on 12 October where it sustained heavy casualties, mainly due to German gas attacks. The battalion remained in Belgium for the following five months, rotating between the front and rear areas. In March 1918, it moved to France to help blunt the German spring offensive, repelling a German attack around Morlancourt. During the lull that followed, the battalion was subsequently involved in the Battle of Hamel on 4 July 1918. When the Allies launched their own offensive in August, the 42nd Battalion was involved in the initial attack around Amiens and then the subsequent advance that followed as the Allies attempted to penetrate the Hindenburg Line. Its final involvement in the fighting came during the fighting at St Quentin Canal during the period 29 September to 2 October. After this, the Australian Corps was withdrawn from the line for rest and reorganisation, and the 42nd Battalion was disbanded on 22 October 1918 to provide reinforcements for other AIF units, which had suffered heavy casualties throughout the year. During its service the battalion sustained a total of 544 killed and 1,450 wounded. The battalion's last man (of 2,954), Sergeant Robert S. Melloy, died on 23 January 1995, at age 97.