Stanhope was born in Paris in 1673, the eldest of the seven children of Alexander Stanhope (1638–1707), and his wife Katherine (died 1718), the daughter and co-heir of Arnold Burghill, of Thinghall Parva, Withington, Herefordshire, by his second wife Grizell, co-heir of John Prise of Ocle Pyrchard, Herefordshire. He was educated at Eton College and at Trinity College, Oxford, where he matriculated in May 1688.
Stanhope accompanied his father, then English Ambassador to Madrid, to Spain in 1690, and obtained some knowledge of that country which was very useful to him in later life.
A little later he went to Italy where, as afterwards in Flanders, he served as a volunteer against France, and in 1695 he secured a commission in the English army. In 1701 Stanhope entered the House of Commons, but he continued his career as a soldier and was in Spain and Portugal during the earlier stages of the War of the Spanish Succession.
In 1705 he served in Spain under Charles Mordaunt, Earl of Peterborough, notably at the Siege of Barcelona and in 1706 he was appointed English minister in Spain, but his duties were still military as well as diplomatic, and in 1708, after some differences with Peterborough, who favoured defensive measures only, he was made commander-in-chief of the British forces in that country.
Taking the offensive he captured Port Mahon, Minorca, and after a visit to England, where he took part in the impeachment of Sacheverell, he returned to Spain and in 1710 helped to win the battles of Almenar and of Saragossa, his perseverance enabling the Archduke Charles to enter Madrid in September. However, at Brihuega he was overwhelmed by the French and was forced to capitulate on 9 December 1710. The defeat proved a devastating setback to Allied ambitions in Spain, and ultimately led to Philip V retaining the Spanish throne.
He remained a prisoner in Spain for over a year and returned to England in August 1712. While he was a captive in Spain he stood for and lost a seat in Parliament for Westminster, being defeated by a Tory brewer who made slurs against Stanhope's alleged homosexuality and whipped up popular anti-war sentiment to carry the seat with a landslide.
Once back in Britain he now abandoned his military career and moved wholly into politics. He soon sat for another seat, Wendover, and became one of the leaders of the Whig opposition in the House of Commons.
He had his share in establishing the House of Hanover on the throne, and suppressing the 1715 Jacobite Rebellion in which supporters of James Stuart attempted to place him on the throne.
In September 1714 he was appointed Secretary of State for the Southern Department, sharing with Walpole the leadership of the House of Commons. He was mainly responsible for the measures which were instrumental in crushing the Jacobite rising of 1715, and he forwarded the passing of the Septennial Act.
He acted as George I's foreign minister, and only just failed to conclude a treaty of alliance with France in 1716. In 1717 there was a dramatic schism in the Whig Party with Stanhope and Sunderland forming one grouping while Walpole and Townshend opposed them.
In 1717, consequent on changes in the ministry, Stanhope was made First Lord of the Treasury, and was the last Chancellor of the Exchequer to sit in the House of Lords. A year later he returned to his former office of secretary for the southern department. On 3 July 1717, he was created Baron Stanhope of Elvaston and Viscount Stanhope of Mahon and, on 14 April 1718, Earl Stanhope. He was in all but name Prime Minister and is sometimes presented as the first Prime Minister of Great Britain, rather than Sir Robert Walpole who is more usually considered as that figure.
He saw Britain's principal foreign policy goals as containing the threat of Spanish, Austrian or Russian expansionist tendencies. His activity was now shown in the conclusion of the Quadruple Alliance between Britain, France, Austria and the United Provinces in 1718, and in obtaining peace for Sweden, when threatened by Russia and Denmark. He entered delicate negotiations with Spain which wished for the return of Gibraltar, which he was only prepared to do in exchange for Cuba and Florida. Ultimately the talks broke down, setting the path to the later Thirteenth Siege of Gibraltar.
In the ensuing War of the Quadruple Alliance British forces were involved in a campaign to prevent Spanish expansion in Italy. Spain landed troops in Scotland in support of the Jacobites who they hoped to restore to the throne. The expedition was defeated at the Battle of Glen Shiel and in retaliation the British dispatched a force that briefly captured Vigo in October 1719.
Domestically, he promoted the bill to limit the membership of the House of Lords a controversial move as it was seen as an attack directed at his former Whig colleagues led by Walpole. His attempts at pushing for greater religious toleration were defeated by Walpole's supporters.
Just after the collapse of the South Sea Bubble, for which he was partly responsible, the earl was defending his government with customary vigour and panache in House of Lords on 4 February 1721 when he was taken ill with a violent headache. After some apparent recovery the following day, he died of a stroke at eight o'clock that evening. The king was shocked and distraught at the sudden "loss of so able and faithful a minister, of whose service his Majesty had so great need at this critical juncture". On the king's orders Stanhope was given a full military funeral through London on 17 February to Southwark, and he was afterwards privately buried at Chevening. He was succeeded by his eldest son Philip (1714–1786), a distinguished mathematician and a fellow of the Royal Society.1673-1701: Mr James Stanhope
1701-1714: Mr James Stanhope MP
1714-1717: The Right Honourable James Stanhope MP
1717-1718: The Right Honourable The First Viscount of Mahon PC
1718-1721: The Right Honourable The First Earl Stanhope PC
On 24 February 1713, Stanhope married Lucy Pitt (1692–1723), a younger daughter of Thomas Pitt, the first governor of Madras, and aunt to William Pitt the Elder. Although Stanhope found little time for domesticity, it was a happy union, and the couple had seven children, including two sets of twins. Several of his children went on to be notable in their own right. His sister Mary, one of Queen Anne's six Maids of Honour, 1702-1707, married Charles, 1st Viscount Fane in 1707.