He was born at Leith Hall, the third son of John Leith and his wife Harriot (née Steuart). His father was shot and killed during a drunken argument when he was only four months old. He was initially educated at home by a private tutor, before attending the grammar school at Elgin, and Marischal College in Aberdeen, and after deciding to join the army was sent to a military academy at Lille.
Leith entered the Army in 1780, first serving as an ensign in the 21st Regiment of Foot. He soon became a lieutenant in the 81st Regiment of Foot (Aberdeenshire Highland Regiment), in which he was made captain on 3 December 1782.
At the end of the American War in 1783 his regiment was disbanded, and he transferred to the 50th Regiment of Foot, stationed at Gibraltar. There he served as aide-de-camp to the governor Sir Robert Boyd, and later as ADC to General Charles O'Hara, whom he accompanied to Toulon during the British occupation of 1793. After O'Hara was taken prisoner, Leith served on the staff of Major-General Sir David Dundas, until the city was evacuated in December, when he returned to Gibraltar. Leith was appointed Town Major of Gibraltar on 15 March 1794, and was appointed to command of an Independent Company of Foot on 19 March.
Leith soon returned home, where on 25 October 1794 he was authorized to raise a regiment of Fencibles. The regiment was presented with its colours on 22 July 1795, and added to the Army establishment the following day as the Aberdeen Fencible Regiment of Foot, but was renamed the Princess of Wales's, or Aberdeen Highland Fencible Infantry later in the year. In August 1795 Leith was brevetted colonel, with the rank of lieutenant-colonel in the army. His regiment was stationed in Ireland, seeing action during the 1798 Rebellion. Leith was promoted to colonel in the army on 1 January 1801, and his regiment was finally disbanded at Naas in April 1803. He was then appointed colonel of the 13th Battalion of Reserve, and from 1804, as a brigadier-general, served on the staff in Ireland.
In 1808, he was promoted to major-general, and following the Spanish victory over the French at Bailén, in July, the Secretary of State for War and the Colonies, Viscount Castlereagh sent Leith at the head of a second delegation (the first, consisting of three British Army officers, led by a lieutenant colonel, had reached Gijón on 27 June 1808 to assess the state of affairs from a military viewpoint) to the Junta General of Asturias, with a view to seeing how the north of Spain could best be reinforced to prevent Napoleon sending in more troops through Irun, and isolating him in Madrid or Burgos. Leith arrived in Gijón on 30 August, and joined Sir David Baird's forces in November.
Leith served in John Moore's campaign in northern Spain in 1808–1809. He commanded a brigade in John Hope's division, that consisted of the 51st, 2/59th and 2/76th Foot. On 7 January at Lugo, Leith's brigade mounted a successful bayonet charge, inflicting 300 casualties on Marshal Nicolas Soult's pursuing French for the loss of only 50 men. At the Battle of Corunna on 16 January, Leith's 2,400-man brigade held the centre of the line against Soult's attacks.
On his return to England, Leith served on the staff, seeing active service during the Walcheren Campaign, before returning home at the end of the year suffering from "Walcheren fever".
When Wellington created the 5th Infantry Division on 8 August 1810, Leith became its commander. The British battalions first assigned to the division, the 3/1st, 1/9th and 2/38th Foot, had been involved in the Walcheren fiasco. These three units became the 1st Brigade, under the command of Lieutenant-Colonel James S. Barnes. Added to this were two Portuguese brigades led by Colonel William F. Spry and Baron von Eben. The 5th Division fought well at the Battle of Bussaco in September 1810, helping to repel the French soldiers of Jean Reynier's II Corps.
Brigadier-General Andrew Hay took command of the 1st Brigade shortly after Bussaco. On 6 October, von Eben's brigade was detached and Major-General James Dunlop's 2nd Brigade became attached to Leith's division. The 2nd Brigade initially consisted of the 1/4th from England, and the 2/30th and 2/44th from Cadiz. For the rest of its wartime career, the 5th Division would include one Portuguese and two British brigades. During the winter of 1810–1811, Leith's soldiers helped man the Lines of Torres Vedras, keeping Marshal André Masséna's French army from capturing Lisbon. Leith went on leave on 1 February, during which time William Erskine and then James Dunlop commanded the division. Leith was promoted to the brevet rank of lieutenant-general in September 1811, finally returning to his division on 1 December 1811.
In April 1812, Leith's division played a key part in the storming of Badajoz. While the 4th and Light Divisions assaulted the breaches and the 3rd Division attacked the castle, the 5th Division escaladed the city wall at the Bastion of San Vincente. The assault on the breaches was a failure, with ghastly losses. However, the French garrison left too few men to guard the rest of the defences and both the 5th and 3rd Divisions succeeded in climbing over the walls. While the 3rd Division became bottled up in the castle, Leith's men got into the town. Blowing their bugles and spreading confusion, the 5th Division panicked the French survivors so that a final effort by the 4th and Light Division broke through the defences. Leith's division lost over 500 men and the commander of the 2nd Brigade, Brigadier-General George Townshend Walker was wounded.
In July 1812, Leith's 5th Division played an important role at the Battle of Salamanca. Advancing in two-deep lines, with the British brigades in the front line, the division's musketry defeated Antoine de Maucune's badly deployed French division. Leith was wounded in the action and sent home to recuperate.
In recognition of his services in Spain Leith was made a Knight Companion of the Order of the Bath on 1 February 1813, and also received an honourable augmentation to his coat of arms. The investiture was held at Carlton House on 4 March 1813. (On 2 January 1815, the Order of the Bath was reorganized and the rank of Knight Companion became Knight Grand Cross.)
He returned to command of the 5th Division on 30 August 1813, and was immediately severely wounded again in the bloody but victorious assault at the Siege of San Sebastián on 31 August. For his services in the Peninsula, Leith was awarded the Army Gold Cross and clasp for Corunna, Busaco, Badajoz, Salamanca, and San Sebastian. On 2 February 1814 he received permission to accept and wear the insignia of an Honorary Knight Commander of the Order of the Tower and Sword, awarded to him by the Prince Regent of Portugal.
On 15 February 1814 he was appointed Governor and Commander-in-Chief of the Leeward Islands. When the news of the return of Bonaparte arrived, the garrison on the French island of Martinique showed signs of declaring their support for him. The Captain-General of Martinique, Pierre René Marie, Comte de Vaugiraud, assembled the troops, informing them that any of them could leave the island, but any attempt to revolt against the authority of the King would be met by force, and punished as an act of mutiny. Meanwhile, Leith assembled his forces at Gros Islet Bay in Saint Lucia, and landed on Martinique on 5 July to occupy the military strongpoints of the island, with de Vaugiraud's willing co-operation.
On 8 August Leith's troops landed on Guadeloupe, where the Governor-General Admiral Charles-Alexandre Linois had declared his allegiance to Bonaparte, and within 48 hours secured a complete capitulation.
In recognition of his efforts on securing France's West Indies possessions, on 20 November 1816 he was granted permission to accept and wear the Grand Cordon of the Order of Military Merit awarded to him by the King of France, however by then Leith was dead, having fallen ill with yellow fever in Barbados on 10 October, and died on 16 October. Leith's body was returned to England, and was buried in the nave of Westminster Abbey on 15 March 1817.
His papers are held by the University of Manchester Library.
In 1798 he married Lady Augusta Forbes, daughter of the George Forbes, 5th Earl of Granard. His heir was his nephew Andrew Leith Hay.