♞
Ruy Lopez
Opening guide · Rama Chess blog
← Opening guides
Opening guide

Ruy Lopez (Spanish Opening): Moves, Plans, Main Lines and Traps

The Ruy Lopez starts with 1.e4 e5 2.Nf3 Nc6 3.Bb5. It is one of the oldest openings in chess and still one of the most played at the very top. This guide explains the ideas, the main variations with ECO codes, a famous trap, and 383 lines you can train on Rama Chess.

6 min read Published October 2026 By 383 trainer lines
▶ Practice this opening in the trainer Gambit trainer All opening guides Practise vs bots
In this guide

What is the Ruy Lopez?

The Ruy Lopez, also called the Spanish Opening, starts with 1.e4 e5 2.Nf3 Nc6 3.Bb5. White's bishop attacks the knight on c6. That knight is the piece that defends Black's e5 pawn, so White is putting slow, long-term pressure on Black's centre.

The opening is named after Ruy Lopez de Segura, a Spanish priest who wrote about it in his chess book of 1561. More than four centuries later it is still a main weapon of world champions. Its ECO codes run from C60 to C99, a fifth of the whole C volume.

Note that 3.Bb5 does not threaten to win the e5 pawn at once. After 3...a6 4.Bxc6 dxc6 5.Nxe5, Black plays 5...Qd4 and wins the pawn back. That is why Black can answer with the calm 3...a6, the Morphy Defence, which is the most common reply.

The main ideas for both sides

White's plans

Black's plans

Advertisement

Main variations of the Ruy Lopez

The Ruy Lopez has more theory than almost any other opening. These are the lines you need to know first. Every move order is checked move by move.

VariationECOMovesIdea
Berlin DefenceC65-C671.e4 e5 2.Nf3 Nc6 3.Bb5 Nf6solid; the Berlin endgame after 4.O-O Nxe4
Exchange VariationC68-C691.e4 e5 2.Nf3 Nc6 3.Bb5 a6 4.Bxc6 dxc6White wins a better pawn majority for the endgame
Schliemann GambitC631.e4 e5 2.Nf3 Nc6 3.Bb5 f5a sharp counter-gambit on f-file
Steinitz DefenceC621.e4 e5 2.Nf3 Nc6 3.Bb5 d6old and solid, but passive
Open Ruy LopezC80-C831.e4 e5 2.Nf3 Nc6 3.Bb5 a6 4.Ba4 Nf6 5.O-O Nxe4Black takes e4 and plays ...d5
Closed Ruy LopezC84-C991.e4 e5 2.Nf3 Nc6 3.Bb5 a6 4.Ba4 Nf6 5.O-O Be7the long main line, slow manoeuvring
Marshall AttackC891.e4 e5 2.Nf3 Nc6 3.Bb5 a6 4.Ba4 Nf6 5.O-O Be7 6.Re1 b5 7.Bb3 O-O 8.c3 d5Black gives a pawn for a kingside attack
Breyer VariationC94-C951.e4 e5 2.Nf3 Nc6 3.Bb5 a6 4.Ba4 Nf6 5.O-O Be7 6.Re1 b5 7.Bb3 d6 8.c3 O-O 9.h3 Nb8the knight re-routes to d7
Chigorin VariationC96-C991.e4 e5 2.Nf3 Nc6 3.Bb5 a6 4.Ba4 Nf6 5.O-O Be7 6.Re1 b5 7.Bb3 d6 8.c3 O-O 9.h3 Na5...Na5, ...c5 and ...Qc7
Zaitsev VariationC921.e4 e5 2.Nf3 Nc6 3.Bb5 a6 4.Ba4 Nf6 5.O-O Be7 6.Re1 b5 7.Bb3 d6 8.c3 O-O 9.h3 Bb7pressure on e4 with the bishop

The Berlin Defence (3...Nf6) became a top-level weapon when Vladimir Kramnik used it in his 2000 world championship match against Garry Kasparov. After 4.O-O Nxe4 5.d4 Nd6 6.Bxc6 dxc6 7.dxe5 Nf5 8.Qxd8+ Kxd8 the queens are off early. Black has lost the right to castle but has the two bishops and a very solid position. Many games here end in a draw.

The Closed Ruy Lopez is the classical main line. After 3...a6 4.Ba4 Nf6 5.O-O Be7 6.Re1 b5 7.Bb3 d6 8.c3 O-O 9.h3 Black must choose a plan: the Breyer (9...Nb8), the Chigorin (9...Na5), the Zaitsev (9...Bb7) or the Smyslov (9...h6). The move h3 stops ...Bg4, which would pin the f3 knight.

The Marshall Attack (8...d5) is a gambit. Frank Marshall made it famous when he used it against Jose Raul Capablanca in 1918. Capablanca won that game, but today the Marshall is considered fully playable for Black. Many White players avoid it with 8.a4 or 8.h3, the so-called Anti-Marshall lines.

Closed Ruy Lopez main line diagram after 9.h3
The Closed Ruy Lopez after 3...a6 4.Ba4 Nf6 5.O-O Be7 6.Re1 b5 7.Bb3 d6 8.c3 O-O 9.h3. White prepares d4 and keeps the bishop on the a2-g8 diagonal.

The Berlin Defense (the Berlin Wall)

The Berlin Defense is 1.e4 e5 2.Nf3 Nc6 3.Bb5 Nf6 (ECO C65-C67). Black ignores the threat to the e5 pawn and develops the knight, attacking e4. It is one of the most solid answers to the Ruy Lopez and a top-level favourite.

The Berlin Wall (Berlin endgame). The main line goes 1.e4 e5 2.Nf3 Nc6 3.Bb5 Nf6 4.O-O Nxe4 5.d4 Nd6 6.Bxc6 dxc6 7.dxe5 Nf5 8.Qxd8+ Kxd8. The queens are gone after only eight moves. Black has lost the right to castle and has doubled c-pawns, but the bishop pair and a very solid position make up for it. White has an extra pawn on the kingside (four against three) and hopes to use it later. Stockfish 18 rates this endgame about +0.2 for White at depth 24: almost equal.

The nickname "Berlin Wall" became famous in the 2000 World Championship in London, where Vladimir Kramnik used the Berlin with Black and Garry Kasparov could not break it. Kramnik won the match without losing a game and took the title.

The Anti-Berlin. Many White players avoid the endgame with 4.d3, keeping the queens on and playing a slow Italian-style game (about +0.2 for Stockfish as well). Other tries are 4.O-O Nxe4 5.Re1 and 4.Qe2.

Is the Berlin good for you? If you like solid positions and endgames, yes. If you want sharp, attacking games with Black, choose the Sicilian or 3...a6 lines instead.

Berlin Defense Berlin Wall endgame diagram after 8.Qxd8+ Kxd8
The Berlin endgame after 1.e4 e5 2.Nf3 Nc6 3.Bb5 Nf6 4.O-O Nxe4 5.d4 Nd6 6.Bxc6 dxc6 7.dxe5 Nf5 8.Qxd8+ Kxd8. Queens are off, the black king stays in the centre and Black has the two bishops.

Traps and typical tactics

The best-known trap in the Ruy Lopez is the Noah's Ark trap. It catches White's bishop with a chain of black pawns. It happens after 1.e4 e5 2.Nf3 Nc6 3.Bb5 a6 4.Ba4 d6 5.d4 b5 6.Bb3 Nxd4 7.Nxd4 exd4. If White now grabs the pawn with 8.Qxd4?, Black plays 8...c5!. The queen must move, and then ...c4 traps the bishop on b3. Stockfish rates the position after 8...c5 as about three pawns better for Black. The lesson: in this line White should play 8.a4, 8.c3 or 8.Bd5 instead (all close to equal for Stockfish).

Other ideas to know:

Noah's Ark trap in the Ruy Lopez, the white bishop on b3 is trapped
The Noah's Ark trap: after 3...a6 4.Ba4 d6 5.d4 b5 6.Bb3 Nxd4 7.Nxd4 exd4 8.Qxd4 c5 9.Qd5 Be6 10.Qc6+ Bd7 11.Qd5 c4 the bishop on b3 has no square.

Who plays the Ruy Lopez?

Almost every world champion has played the Ruy Lopez with White, and many have defended it with Black. Kramnik made the Berlin popular, and today it is a regular guest in elite events. The Marshall Attack is a favourite of strong Black players who want active play. Engines also play the Spanish a lot; you can see examples in our engine games in the Ruy Lopez.

Is it right for you? The Ruy Lopez rewards patience and planning more than memory. If you like rich middlegames where you slowly build pressure, it is a great choice. If you want quicker, simpler attacks with White, try the Italian Game first.

Practice the Ruy Lopez in the Rama Chess trainer

Reading a guide is the first step. To make the moves stick, practise them. Our opening trainer has 383 Ruy Lopez lines. Each one is checked with Stockfish. You watch the moves with arrows, replay them from memory, then take a test. Some lines are free for everyone; the others are part of Rama Chess Premium.

The Rama Chess trainer has a very large Ruy Lopez section. A good path: start with the Berlin (C65-C67), then the Closed main lines (C84 and C88-C99). Two lines are free for everyone.

See all our chess opening guides.

Ruy Lopez FAQ

What are the moves of the Ruy Lopez?

The Ruy Lopez, or Spanish Opening, is 1.e4 e5 2.Nf3 Nc6 3.Bb5. The most common reply is 3...a6, the Morphy Defence.

Why is it called the Ruy Lopez?

It is named after Ruy Lopez de Segura, a Spanish priest who studied the opening in his chess book published in 1561. That is also why it is called the Spanish Opening.

What is the Berlin Defence?

The Berlin Defence is 1.e4 e5 2.Nf3 Nc6 3.Bb5 Nf6. It is very solid. Vladimir Kramnik used it to beat Garry Kasparov in their 2000 world championship match, and it has been popular at top level ever since.

What is the Marshall Attack?

It is a gambit for Black in the Closed Ruy Lopez: 1.e4 e5 2.Nf3 Nc6 3.Bb5 a6 4.Ba4 Nf6 5.O-O Be7 6.Re1 b5 7.Bb3 O-O 8.c3 d5. Black gives a pawn for a strong attack on White's king. Its ECO code is C89.

What is the Noah's Ark trap?

It is a trap where Black's a6, b5 and c4 pawns catch White's bishop on b3. It appears after 1.e4 e5 2.Nf3 Nc6 3.Bb5 a6 4.Ba4 d6 5.d4 b5 6.Bb3 Nxd4 7.Nxd4 exd4 8.Qxd4 c5, followed by ...c4.

Is the Ruy Lopez good for beginners?

Yes, its first moves follow simple principles: develop, attack the centre, castle. But the main lines are long. Beginners should learn the plans (c3, d4, Re1, h3) rather than memorise deep theory.

What is the Berlin Wall in chess?

It is the endgame of the Berlin Defence: 1.e4 e5 2.Nf3 Nc6 3.Bb5 Nf6 4.O-O Nxe4 5.d4 Nd6 6.Bxc6 dxc6 7.dxe5 Nf5 8.Qxd8+ Kxd8. The queens come off early and Black defends a solid position with the two bishops. Kramnik used it to beat Kasparov in 2000.

How do you play against the Berlin Defense?

You can enter the Berlin endgame with 1.e4 e5 2.Nf3 Nc6 3.Bb5 Nf6 4.O-O Nxe4 5.d4, or avoid it with the Anti-Berlin 1.e4 e5 2.Nf3 Nc6 3.Bb5 Nf6 4.d3, which keeps the queens on the board.

Watch on YouTube

Prefer video? Our channels show real games move by move, with clear explanations.

▶
Stockfish 100 — engine games explained
youtube.com/@stockfish100
›
▶
Best Chess Channel — tactics, traps and training
youtube.com/@bestchesschannel
›

Ready to practise?

You know the ideas. Now train the moves until you play them without thinking.