The Battle of Inverkeithing was a battle of the Wars of the Three Kingdoms. It was fought on 20 July 1651 between an English Parliamentarian army under John Lambert and a Scottish Covenanter army acting on behalf of Charles II, led by Sir John Brown of Fordell. Lambert's force was a seaborne expedition landed at Fife to get around the main Scottish position at Stirling. The battle resulted in a decisive English victory that gave Oliver Cromwell's forces control of the Firth of Forth and outflanked the defensive position of the main Scottish Army under David Leslie. After his victory at the Battle of Dunbar Oliver Cromwell went on to occupy large parts of southern Scotland. David Leslie, commanding the royalist forces, in recovering from the disaster at Dunbar, created a series of defensive redoubts in the centre of the country, effectively preventing the New Model Army from making any further progress in the campaign. Unable to push past Leslie, firmly entrenched at Stirling, Cromwell was quick to realise that Fife, on the northern shore of the Firth of Forth, was now the key of the whole campaign. Once across the Forth the English would be able to march on Perth and cut the Scots lines of communication with their northern hinterland, now essential for both supplies and recruits.
A seaborne invasion of Fife was a tricky operation. Early in 1651 the Council of State, the executive authority of the Commonwealth, had ordered the construction of special flat bottomed boats, which arrived in Leith in April. While this would enable men and horses to be ferried in close to the northern shore, it would take time for the army to land in sufficient strength to fight off a counter-attack. Leslie could easily move sufficient forces from his base at Stirling to throw the invaders back into the sea. Or, alternatively, he could wait for enough Englishmen to cross to Fife before falling on the weakened remnant at Edinburgh, and then sweep south towards England. This was a considerable risk; but the only alternative was another winter of war, which neither the Lord-General nor his men can have viewed with much enthusiasm.