A fore-and-aft rig is a sailing vessel rigged mainly with sails set along the line of the keel, rather than perpendicular to it as on a square rigged vessel.
Fore-and-aft rigged sails include staysails, Bermuda rigged sails, gaff rigged sails, gaff sails, gunter rig, lateen sails, lug sails, tanja sails, the spanker sail on a square rig and crab claw sails.
Fore-and-aft rigs include:
Barques and barquentines are partially square rigged and partially fore-and-aft rigged.
A rig which combines both on a foremast is known as a hermaphroditic rig.
The fore-and-aft rig is believed to have been first developed independently by the Austronesian peoples some time around 1500 BC with the invention of the crab claw sail. It is suggested that it evolved from a more primitive "V"-shaped "square" sail with two spars that come together at the hull. Crab claw sails spread from Maritime Southeast Asia to Micronesia, Island Melanesia, Polynesia, and Madagascar via the Austronesian migrations. Austronesians in Southeast Asia also later developed other types of fore-and-aft sails, such as the tanja sail (also known as the canted square sail, canted rectangular sail, or the balance lug sail).
Their use later spread into the Indian Ocean since the first millennium, among vessels from the Middle East, South Asia, and China.
The square rig had predominated in Europe since the dawn of sea travel, but in the generally gentle climate of southern Europe and the Mediterranean Sea during the last few centuries before the Renaissance the fore-and-aft began to replace it. By 1475, its use increased, and within a hundred years the fore-and-aft rig was in common use on rivers and in estuaries in Britain, northern France, and the Low Countries, though the square rig remained standard for the harsher conditions of the open North Sea as well as for trans-Atlantic sailing.
The triangular lateen sail was more maneuverable and speedier, while the square rig was labor-intense but seaworthy.