Crossbows were eventually replaced in warfare by gunpowder weapons, although early guns had slower rates of fire and much worse accuracy than contemporary crossbows. The Battle of Cerignola in 1503 was largely won by Spain through the use of matchlock firearms, marking the first time a major battle was won through the use of firearms. Later, similar competing tactics would feature harquebusiers or musketeers in formation with pikemen, pitted against cavalry firing pistols or carbines. While the military crossbow had largely been supplanted by firearms on the battlefield by 1525, the sporting crossbow in various forms remained a popular hunting weapon in Europe until the eighteenth century.