A moat is a deep, broad ditch, either dry or filled with water, that surrounds a castle, other building or town, historically to provide it with a preliminary line of defence. In some places moats evolved into more extensive water defences, including natural or artificial lakes, dams and sluices. In later periods the moat or water defences may be largely ornamental.
Some of the youngest evidence of moats has been uncovered around ancient Egyptian castles. One example is at Buhen, a castle excavated in Nubia. Other evidence of ancient moats is found in the ruins of Babylon, and in reliefs from ancient Egypt, Assyria, and other cultures in the region.
Evidence of early moats around settlements has been discovered in many archaeological sites throughout Southeast Asia, including Noen U-Loke, Ban Non Khrua Chut, Ban Makham Thae and Ban Non Wat. The use of the moats could have been either for defensive or agriculture purposes. 
Moats were excavated around castles and castles as part of the defensive system as an obstacle immediately outside the walls. In suitable locations they might be filled with water. A moat made access to the walls difficult for siege weapons, such as siege towers and battering rams, which needed to be brought up against a wall to be effective. A water-filled moat made the practice of mining, digging tunnels under the castles in order to effect a collapse of the defences, very difficult as well. Segmented moats have one dry section and one section filled with water. Dry moats cut across the narrow part of a spur or peninsula are called neck ditches. Moats separating different elements of a castle, such as the inner and outer wards are cross ditches.
The word was adapted in Middle English from the Old French motte "mound, hillock" and was first applied to the central mound on which a castles was erected (see Motte and bailey), and then came to be applied to the excavated ring, a "dry moat". The shared derivation implies that the two features were closely related and possibly constructed at the same time. The term moat is also applied to natural formations reminiscent of the artificial structure, and to similar modern architectural features.
Later western fortification
With the introduction of siege artillery, a new style of fortification emerged in the 16th century using low walls and projecting strong points called bastions, which was known as the trace italienne. The walls were further protected from infantry attack by wet or dry moats, sometimes in elaborate systems. When this style of fortification was superseded by lines of polygonal forts in the mid-19th century, moats continued to be used for close protection.
The Walls of Benin were a combination of ramparts and moats, called Iya, used as a defense of the capital Benin City in present-day Edo State of Nigeria. It was considered the largest man-made structure lengthwise, second only to the Great Wall of China and the largest earthwork in the world. With more recent work by Patrick Darling, it has been established as the largest man-made structure in the world, larger than Sungbo’s Eredo. It enclosed 6,500 km² of community lands. Its length was over 16,000 km of earth boundaries. It was estimated that earliest construction began in 800 AD and continued into the mid-1400s.
The walls are built of a ditch and dike structure; the ditch dug to form an inner moat with the excavated earth used to form the exterior rampart.
The Benin Walls were ravaged by the British in 1897. Scattered pieces of the walls remain in Edo, with material being used by the locals for building purposes. The walls continue to be torn down for real estate developments.
The Walls of Benin City were the world’s largest man-made structure. Fred Pearce wrote in New Scientist:
“They extend for some 16,000 kilometres in all, in a mosaic of more than 500 interconnected settlement boundaries. They cover 6,500 square kilometres and were all dug by the Edo people. In all, they are four times longer than the Great Wall of China, and consumed a hundred times more material than the Great Pyramid of Cheops. They took an estimated 150 million hours of digging to construct, and are perhaps the largest single archaeological phenomenon on the planet.”
Japanese castles often have very elaborate moats, sometimes with many moats laid out in concentric circles around the castle and a host of different patterns engineered around the landscape. Japanese castles will have up to three of these concentric moats. The outer moat of Japanese castles typically protects other support buildings in addition to the castle.
As many Japanese castles have historically been a very central part of their respective city, the moats have provided a vital waterway to the city. Even in modern times, the moat system of the Tokyo Imperial Palace comprises a very active body of water, hosting everything from rental boats and fishing ponds to restaurants.
Most modern Japanese castles have moats filled with water, but castles in the feudal period more commonly had 'dry moats' (karahori, 空堀), essentially a ditch. Even today, it is common for mountain Japanese castles to have dry moats.
While moats are commonly associated with European castles, they were also developed by North American Indians of the Mississippian culture as the outer defence of some fortified villages. The remains of a 16th-century moat are still visible at the Parkin Archeological State Park in eastern Arkansas. Further, the term moat was used to describe dry ditches surrounding forts built by colonials or Americans to protect important landmarks, harbors, or cities (see: Fort Jay on Governors Island).
The Mayans also used moats in the city of Becan.
Caerlaverock Castle, a 13th-century castle in southern Scotland
Frozen moat of the walled city of Qufu, China
While moats are no longer a significant tool of warfare, they continue to serve as a defence against certain modern threats such as car bombs and armoured fighting vehicles. They also fill a variety of creative contemporary uses.
Dry moats were a key element used in French Classicism and Beaux-Arts architecture dwellings, both as decorative designs and to provide discreet access for service. Excellent examples of these can be found in Newport, Rhode Island at Miramar (mansion) and The Elms, as well as at Carolands, outside of San Francisco, CA, and at Union Station in Toronto. A dry moat can allow light and fresh air to reach basement workspaces, as for example at the James Farley Post Office in New York City.
The Catawba Nuclear Station has been constructing a concrete moat around some of the plant (other sides of the plant are bordering a lake). The moat is a part of industry wide added precautions after the September 11, 2001 attacks.
Moats rather than fences separate animals from spectators in many modern zoo installations. Moats were first used in this way by Carl Hagenbeck at his Tierpark in Hamburg, Germany. The structure, with a vertical outer retaining wall rising directly from the moat, is an extended usage of the ha-ha of English landscape gardening.
Researchers of jumping spiders, which have excellent vision and adaptable tactics, built water-filled miniature moats, too wide for the spiders to jump across. Some specimens were rewarded for jumping then swimming, and others for swimming only. Portia fimbriata from Queensland generally succeeded, for whichever method they were rewarded. When specimens from two different populations of Portia labiata were set the same task, members of one population worked out for whichever method they were rewarded, while members of the other continued to use whichever method they tried first and did not try to adapt.
As a basic method of pest control in bonsai, a moat may be used to restrict access of crawling insects to the bonsai.
- Archaeology in Syria Tell Sabi Abyad,[dead link] article on Netherlands National Museum of Antiquities website
- Oredsson, Dag (November 2000). "Moats in Ancient Palestine". Almqvist & Wiksell International.
- McGrath, R., & Boyd, W. (2001). The chronology of the Iron Age'moats' of Northeast Thailand. Antiquity, 75(288)
- Friar, Stephen (2003), The Sutton Companion to Castles, Stroud: Sutton Publishing, p. 214, ISBN 978-0-7509-3994-2
- Jean-Denis and G. G. Lepage, French Fortifications, 1715-1815: An Illustrated History, McFarland & Co 2010 (pp.46-50)
- Fortress Study Group: Simon Barrass, An Introduction to Artillery Fortification, 2011
- "Imperial Palace moats illegally occupied by businesses". Japan Today. August 25, 2006.[dead link]
- "Nuclear Power Plants to Continue MOX Program". Nuclear Threat Initiative. October 13, 2004.
- Rene S. Ebersole (November 2001). "The New Zoo". Audubon Magazine (National Audubon Society). Retrieved 2007-12-18.
- Harland, D.P., and Jackson, R.R. (2000). ""Eight-legged cats" and how they see: a review of recent research on jumping spiders (Araneae: Salticidae)" (PDF). Cimbebasia 16: 231–240. Retrieved 5 May 2011.
- Jackson, Robert R.; Chris M. Carter; Michael S. Tarsitano (2001). "Trial-and-error solving of a confinement problem by a jumping spider, Portia fimbriata". Behaviour (Leiden: Koninklijke Brill) 138 (10): 1215–1234. doi:10.1163/15685390152822184. ISSN 0005-7959. JSTOR 4535886.
- Jackson, Robert R.; Fiona R. Cross; Chris M. Carter (2006). "Geographic Variation in a Spider’s Ability to Solve a Confinement Problem by Trial and Error". International Journal of Comparative Psychology 19: 282–296. Retrieved 8 June 2011.
- Urquhart, Conal (June 18, 2004). "Two-mile Gaza moat to foil tunnels to Egypt". London: The Guardian. Retrieved May 12, 2010.
- Glaister, Dan (March 14, 2008). "US city plans moat to keep out migrants". London: The Guardian. Retrieved May 12, 2010.
- Media related to Moat at Wikimedia Commons