In 1296, Edward invaded Scotland. He removed King John from power, and put him in jail. The following year William Wallace and Andrew de Moray raised an army from the southern and northern parts of the country to fight the English. Under their joint leadership, an English army was defeated at the Battle of Stirling Bridge. For a short time Wallace ruled Scotland in the name of John Balliol as Guardian of the realm.