On 24 April 1793, Elphinstone was appointed a second lieutenant in the Royal Engineers.
He saw his first service in the Peninsular War at the Battle of Roliça, where he was badly wounded and subsequently left the theatre.