When you think of the Middle Ages, you might imagine knights, lords and ladies, jousting competitions and bloody battles -- probably taking place in or around a castle. Castles were important staging points for conquests and defenses of territories in medieval times. The designs and constructions of these fortresses varied greatly, and many survive today.

The Merriam-Webster Collegiate dictionary defines a castle as a "fortified group of buildings" [source: Merriam-Webster]. But a more practical definition is that a castle was a fortification of the High Middle Ages (10th to 15th century) equipped with high walls, towers and a moat. The word "castle" comes from the Latin word "castellum," which means "fortified place." The French popularized the term "castle" in the Middle Ages.

Castles served a primarily military purpose -- they housed armies and acted as garrisons that controlled a particular territory. Many castles were part of fortified towns and sheltered the surrounding villagers in times of war and siege. As time went on, castles also became residences for lords and kings. Near the end of the Middle Ages into the modern era, castles lost their military function and either functioned as residences for the nobility or were abandoned altogether.

In this article, we'll examine where castles came from, how they were constructed, how they were used, how they were attacked and defended, and what became of them.