He enlisted in the Second Infantry Regiment with the rank of second Lieutenant on October 5, 1846. He was transferred to the newly raised 3rd U.S. Dragoons on April 9, 1847. He fought in the Mexican–American War and was cited for gallantry during the battles of Churubusco and Molino del Rey. In the later action Thorn and several other officers that volunteered to move and serve as crew of an artillery piece under the command of Captain Simon H. Drum that had a decisive effect on the battle. He was promoted to captain on September 8, 1847 for that action.