Born the son of Sir Michael Shaw Stewart, 5th Baronet and Catherine Stewart, Stewart joined the Royal Navy in February 1805. He was appointed to the fifth-rate HMS Medusa which was engaged to transport Lord Cornwallis, Governor-General of Bengal, to Calcutta. He transferred to the third-rate HMS Revenge and took part in the blockade of Brest and then in the action of 25 September 1806 when four French frigates were captured by a squadron commanded by Commodore Sir Samuel Hood during the Napoleonic Wars. He transferred to the fifth-rate HMS Imperieuse, commanded by Captain Thomas Cochrane, in October 1806 and took part in various raids on the Mediterranean coast of France during 1807 and in the defence of Rosas, which was under siege by the French Army, in November 1808. Still in HMS Imperieuse, he saw action again during the attack on Flushing during the unsuccessful Walcheren Campaignin the Summer of 1809. He transferred to the fourth-rate HMS Adamant at Leith in November 1809 and to the fifth-rate HMS Hussar in the Baltic Sea in May 1810. where Stewart served as Captain-Superintendent After serving briefly in the first-rate HMS Royal William at Portsmouth, Stewart was promoted to lieutenant on 1 August 1811 and served in the fifth-rate HMS Alexandria at Leith and then in the third-rate HMS Tigre in which he took part in the blockade of Rochefort in Spring 1812. He transferred to the first-rate HMS San Josef, flagship of the Commander-in-Chief, Channel Squadron, in May 1812 and to the first-rate HMS Queen Charlotte, the next flagship of the Commander-in-Chief, Channel Fleet, in January 1813. He became acting commanding officer of the third-rate HMS Clarence off Brest in March 1814 and acting commanding officer of the sloop HMS Podargus off Finisterre in June 1814. Promoted to commander on 13 August 1814, Stewart was posted to the Jamaica station where he commanded successively the sloops HMS Shark, HMS Royalist and HMS Rifleman and commanded, on an acting basis, the fifth-rate HMS Pique and then the fourth-rate HMS Salisbury. Promoted to captain on 10 June 1817, he became commanding officer of the sixth-rate HMS Menai on the North America and West Indies Station in October 1823 and was simultaneously commanding officer of the Halifax Dockyard for much of his tour. At the 1837 general election Stewart stood for Parliament in Renfrewshire, but was unsuccessful. He became commanding officer of the third-rate HMS Benbow in the Mediterranean Fleet in April 1839 and took part in the bombardment of Acre in November 1840 during the Egyptian–Ottoman War. For his service in the War he was appointed a Companion of the Order of the Bath on 18 December 1840. He observed the Egyptian withdrawal and then rescued Greek nationalists escaping from Candia following an uprising against the Ottoman Empire. Stewart became Captain-Superintendent of Woolwich Dockyard and Captain of the royal yacht HMY William and Mary in May 1846 and Controller-General of the Coastguard in November 1846.
Senior command
Stewart was appointed Third Naval Lord in February 1850 and, having been promoted to rear admiral on 16 June 1851, he entered the House of Commons at a by-election in February 1852 as Liberal Party Member of Parliament MP for Greenwich, following the resignation of Sir James Dundas. Following his election he became Second Naval Lord in the First Derby Ministry in February 1852. However, he stayed at the Admiralty for only a few weeks and lost his seat in Parliament at the general election in July 1852. Stewart became Admiral Superintendent of Malta Dockyard, with his flag in the fifth-rate HMS Ceylon, in April 1853 and second-in-command in the Black Sea, with his flag in the second-rate HMS Hannibal in January 1855. He took part in the Siege of Sevastopol in Winter 1854 and commanded the fleet at the capture of Kinburn in October 1855 during the Crimean War. For his services in the war, he was advanced to Knight Commander of the Order of the Bath on 5 July 1855, appointed to the French Legion of Honour, 2nd Class on 30 April 1857 and awarded the Turkish Order of the Medjidie, 1st Class on 2 March 1858. Stewart went on to be Admiral Superintendent of Devonport Dockyard, with his flag in the second-rate HMS Indus, early in 1856 and Commander-in-Chief, North America and West Indies Station, with his flag in HMS Indus again, in November 1856. Promoted to vice-admiral on 30 July 1857, he became Commander-in-Chief, Plymouth, with his flag in the second-rate HMS Impregnable, in October 1860. Promoted to full admiral on 10 November 1862 and advanced to Knight Grand Cross of the Order of the Bath on 28 March 1865, he was appointed Governor of Greenwich Hospital in February 1869 and promoted to Admiral of the Fleet on 20 October 1872. He died at his home in Port William in Wigtownshire on 10 December 1875.