On a sunny summer afternoon, the Tower, one of the best-preserved medieval castles in the world, can be a cheerful buzzing place, filled with happy swarms of tourists being entertained by costumed actors and historically themed events. At such times it can be easy to forget that beneath all the kitschy tourist trappings lies a very real castle with a very brutal and bloody history.

The Tower is actually a compound of structures built at various times for varying purposes. The oldest is the White Tower, begun by William the Conqueror in 1078 to keep London's native Saxon population in check. Later rulers added towers, walls, and fortified gates, until the buildings became like a small town within a city. Although it began life as a stronghold against rebellion, the tower's main role eventually became less about keeping people out, than making sure whoever was inside couldn't escape. It became the favored prison and execution site for anyone who displeased the monarch. Notable prisoners served their last meals here include the "princes in the tower," Lady Jane Grey (who reigned as queen for just nine days before being toppled by Mary I in 1553), and Anne Boleyn, one of several unfortunates who thought that marrying that most unforgiving of monarchs, Henry VIII, was a good idea. A plaque on Tower Green marks the spot where they met their grisly ends.

Displays on some of the Tower's captives can be seen in the Bloody Tower, including a reconstruction of the study of Sir Walter Raleigh, the great Elizabethan adventurer who is generally credited with having introduced tobacco-smoking to England. A favorite of Elizabeth I, he was executed by James I, a fervent anti-smoker, having spent 13 years as a prisoner here.

In addition to being a prison, the Tower has also been used as a royal palace, a mint, and an armory. Today, however, it's perhaps best known as the keeper of the Crown Jewels, the main ceremonial regalia of the British Monarch, which -- when not being used -- are displayed in the tower's Jewel House. It's probably best to tackle this soon after your arrival, as the line ups seem to build exponentially over the course of the day. You hop aboard a travelator for a slow glide past some of the Queen's top trinkets, including the Imperial State Crown (as modeled each year at the State Opening of Parliament), which looks like a child's fantasy of a piece of royal headwear, set with no fewer than 3,000 jewels, including the fourth-largest diamond in the world.

After the jewels, the tower's next most popular draw is probably the Royal Armory located in the White Tower, where you can see various fearsome-looking weapons, including swords, halberds, and morning stars, as well as bespoke suits of armor made for kings. The complex also boasts the only surviving medieval palace in Britain, dating back to the 1200s. It stands in the riverside wall above Traitors' Gate, through which prisoners were brought to the Tower. You can see reconstructed bedrooms, a throne room, and chapel.

Be sure to take advantage of the free hour-long tours offered by the iconic guards, the Yeoman Warders -- more commonly known as "Beefeaters." They'll regale you with tales of royal intrigue, and introduce you to the Tower's current most famous residents, the six ravens who live on Tower Gardens. According to legend, if the ravens ever leave the Tower, the monarchy will fall -- the birds' wings are kept clipped, just to make sure. The tours take place every half-hour from 9:30am until 3:30pm in summer (2:30pm in winter) and leave from the Middle Tower near the entrance.

It's also possible to watch the Ceremony of the Keys, the ritual locking of the Tower gates, but to do so you'll have to apply in writing at least two months in advance. Despite the brevity of the operation -- you arrive at 9:30pm and it's all over by 10pm, when the Last Post sounds -- it's extremely popular. You can apply for two tickets and will need to supply two possible dates when you can attend, plus a stamped, addressed envelope (and if you're applying from abroad the stamps must be British -- foreign stamps are not valid in the U.K.).

Tower Tips -- Tickets are cheaper if booked online: £16 for adults, £9 for children. If buying your ticket at the venue, pick them up at the kiosk at Tower Hill Tube station before emerging above ground -- the lines should be shorter. Even so, choose a day other than Sunday -- crowds are at their worst then -- and arrive as early as you can in the morning, or late in the afternoon.