Lesley was said to have served as a private trooper in the Tangier Cavalry, but by 1664 he held a commission as cornet in one of three troops of Horse at Tangier. On 15 December 1674 he was promoted captain in the Tangier Regiment, with which he served with reputation and had opportunities of distinguishing himself against the Moors. By 1680 he had been knighted, and King Charles II promoted him to the majority of his regiment on 10 November that year; in 1681 he was sent as ambassador to the Court of Morocco. He served against the rebels under the Duke of Monmouth in the summer of 1685, was at the Battle of Sedgemoor, and was rewarded by King James II with the lieutenant-colonelcy of the Queen Dowager's Regiment on 19 September 1687. Joining the interests of the Prince of Orange at the Revolution, he was nominated colonel of the 15th Regiment of Foot on 31 December 1688, with which corps he served against the insurgent clans in Scotland, and also under King William III in Flanders. He commanded a brigade at the attack of Fort Kenoque in 1695, and was afterwards engaged in the defence of Diksmuide. He yielded to the suggestions of the governor and voted in a council of war for the surrender of the town, for which he was cashiered by sentence of a general court-martial. The governor, the Dutch general Ellemberg, was beheaded at Ghent.