The Ruy Lopez, sometimes known as the Spanish, is a chess opening characterised by the moves 1.e4 e5 2.Nf3 Nc6 3.Bb5 (in algebraic notation).

The opening is named after the 16th century Spanish priest of the same name who described it in his 1561 book on chess.

It should be noted that White's apparent threat to win Black's e-pawn with 4.Bxc6 dxc6 5.Nxe5 is illusory - Black can respond with 5...Qd4, forkinging the knight and e4-pawn, and winning back the material with a good position. Given, therefore, that White's third move carries no immediate threat, Black can respond in a wide variety of ways.

By far the most commonly seen is 3...a6 (the Morphy Defence), when the game can take a number of paths. Bobby Fischer often played the Exchange Variation - 4.Bxc6 - with White; the normal follow-up to this is 4...dxc6 5.O-O f6, although there are alternatives. The Exchange Variation, however, is generally considered to not present enough difficulties for Black.

Instead, White normally retreates his bishop with 4.Ba4. The normal continuation is now 4...Nf6 5.O-O Be7 6.Re1 b5 7.Bb3 (again, there are reasonable alternatives for both sides). Now 7...d6 8.c3 O-O 9.h3 (preventing 9...Bg4, which can be awkward for White) is the so-called "closed" Ruy Lopez, which can be considered the main line of the opening. Many hundreds of top-level games have reached this position. Black has a variety of choices here, the most commonly played options being 9...Na5 (the Chigorin variation, freeing the pawn to go to c5), 9...Nb8 (the Breyer variation, rerouting the knight to d7) and 9...Bb7 (the Zaitsev variation).

One of Black's more aggressive alternatives is the Marshall Gambit: after 3...a6 4.Ba4 Nf6 5.O-O Be7 6.Re1 b5 7.Bb3 O-O 8.c3 Black plays 8...d5, sacrificing a pawn with 9.exd5 Nxd5 10.Nxe5 Nxe5 11.Rxe5. In exchange, Black has an attack on White's king: 11...c6 12.d4 Bd6 13.Re1 Qh4. This attack can be quite dangerous for White, and a number of anti-Marshall systems have been developed, such as 8.a4 (instead of 8.c3).

An earlier alternative for White is 6.Qe2 (instead of 6.Re1), the Worrall Attack. The idea is that the queen will support the e-pawn, while the rook slides across to d1 to support the advance of the d-pawn (there isn't always time for this to happen, however). Paul Keres played the line several times. More recently, Sergei Tiviakov has played it, as has Nigel Short, who played it twice in his 1992 match against Anatoly Karpov and won both games.

A black alternative is 5...Nxe4 (instead of 5...Be7), the Open Variation. It should be noted that Black cannot safely hang onto the pawn - play usually continues 6.d4 b5 7.Bb3 d5 8.dxe5 and material balance is restored. This is a sharper line than many others in which Black has more freedom for his pieces than the closed variations. The variation has been adopted by a number of players, perhaps most notably by Viktor Korchnoi.

Alternatives for black on move three are less often seen, although Vladimir Kramnik successfully used the Berlin Defence (3...Nf6) as a drawing variation against Garry Kasparov in their 2000 World Championship match.

Other defences include the Steinitz (3...d6), the Schliemann (3...f5), the Cozio (3...Nge7), the Smyslov (3...g6), the Bird (3...Nd4) and the Classical (3...Bc5).