In 1917, Kilmer enlisted as a private in the Seventh Regiment, National Guard, New York, and was later transferred to the 165th Infantry USA, a unit of the Rainbow Division. It was Kilmer's intention when he left New York to write a war book, but on July 30, 1918, Kilmer, now a sergeant, was killed in action near the Ourcq in France. Kilmer and a few other soldiers had advanced into a wooded area for the purpose of locating enemy machine guns. Kilmer was killed by a single bullet through the brain. He is buried at the edge of a little copse known as the Wood of the Burned Bridge, close to the Ourcq in France.
It is believed by some that Kilmer wrote trees on the battlefield. As he was lying, fatally wounded, he saw a stillstanding tree. The legend has it that he wrote Trees and almost immediately after being done, went to his eternal reward.