On March 4, 1845, Lee was promoted to 1st lieutenant. His unit was transferred to Texas in September of that year and placed under General Zachary Taylor. At the battles of Palo Alto and Resaca de la Palma, he commanded a company of the regiment, serving alongside 1st Lieutenant James Longstreet. He would write a poem about both of these battles.