# Queen versus rook endgame

The queen versus rook endgame is a chess endgame where one player has just a king and queen, and the other player has just a king and rook. As no pawns are on the board, it is a pawnless chess endgame. The side with the queen wins with best play, except for a few rare positions where the queen is immediately lost, or because a draw by stalemate or perpetual check can be forced. However, the win is difficult to achieve in practice, especially against precise defense.
Normally, the winning process involves first winning the rook with the queen via a fork and then checkmating with the king and queen, but forced checkmates with the rook still on the board are possible in some positions or against incorrect defense. With perfect play, in the worst winning position, the queen can win the rook or checkmate within 31 moves.
This endgame was known to be won since the 18th century, but it was then thought to be an easier win than it actually is. Since this endgame only has four pieces, it was fully analysed by computers in 1978, and this revealed subtleties overlooked by earlier writers.

## History

In 1895, Edward Freeborough edited an entire 130-page book of analysis of this endgame, titled The Chess Ending, King & Queen against King & Rook.
Because it has only four pieces, queen versus rook was one of the first endings to be solved by endgame tablebases. Just after the ending was fully analysed by computers, a challenge was issued to Grandmaster Walter Browne in 1978, where Browne would have the queen in a difficult position, defended by Belle using the queen versus rook tablebase. Browne could have won the rook or checkmated in 31 moves with perfect play. After 45 moves, Browne realized that he would not be able to win within 50 moves, according to the fifty-move rule. Browne studied the endgame and, later in the month, played another game from a different starting position. This time, he won by capturing the rook on the 50th move.

## Overview

John Nunn's Secrets of Pawnless Endings splits the ending into four phases:
* The attacker should activate their king, and attempt to drive the enemy king to an edge.
* The defender may try to set up a fourth-rank defense, which should be broken.
* The defender now tries to set up a third-rank defense, which is itself broken.
* Finally, the defender sets up a second-rank defense, which is defeated by conversion to Philidor's position.
Nunn recommends that the defender try to pass through all four stages, and cautions that prematurely giving up a fourth- or third-rank defense is a common error.
Karsten Müller and Frank Lamprecht consider breaking the third-rank defense as the first stage, noting that this is the stage where computer analysis showed the greatest difficulties. They also add a final stage, consisting of picking up the rook by a fork after Philidor's position has been achieved. Because of this, a common defensive motif for Black is to put the rook on the same diagonal as White's king to prevent forks.
David Smerdon calls queen versus rook "the most underappreciated endgame in chess", noting that it is often not taught in much detail, despite its commonness. He argues that the reason for its neglect is that the queen usually wins when both players have the same amount of knowledge, but points out that the superior side's task is "extraordinarily difficult" when the inferior side knows the best defensive technique.
The following discussion assumes that White has the queen and Black has the rook. Not all the lines given are optimal according to the tablebase, because sometimes a slightly longer but more systematic win is more intuitive for human players.

### Philidor's position

| | a | b | c | d | e | f | g | h | |
| 8 | | | | | | | | | 8 |
| 7 | | | | | | | | | 7 |
| 6 | | | | | | | | | 6 |
| 5 | | | | | | | | | 5 |
| 4 | | | | | | | | | 4 |
| 3 | | | | | | | | | 3 |
| 2 | | | | | | | | | 2 |
| 1 | | | | | | | | | 1 |
| | a | b | c | d | e | f | g | h | |
This position is won with either side to move. If White is to move, triangulation with the queen will transfer the move to Black, by 1.Qe5+ (1.Qd5 also works) 1...Ka8 2.Qa1+ Kb8 (2...Ra7?! 3.Qh8#) 3.Qa5, and we are back in the original position with Black to move. Now Black is in zugzwang, and wherever they move their rook, it will be lost to a series of checks culminating in a fork:
* 3...Rb1 4.Qd8+ Ka7 5.Qd4+ Ka8 (5...Kb8 changes nothing) 6.Qh8+ Ka7 (6...Rb8 7.Qa1#) 7.Qh7+ forks king and rook.
* 3...Rb2 4.Qe5+ forks.
* 3...Rb3 4.Qe5+ (or 4.Qd8+ Ka7 5.Qd4+ Kb8 6.Qf4+ and the fork 7.Qa4+ cannot be prevented) 4...Ka7 5.Qg7+ Ka8 6.Qg8+ forks.
* 3...Re7 4.Qb4+ forks.
* 3...Rf7 4.Qe5+ (or 4.Qb4+ Ka8 5.Qa3+ Kb8 6.Qb3+ forks; 4...Kc8 5.Qd6 forces mate) 4...Ka7 5.Qe3+ and 6.Qe8+ forks.
* 3...Rg7 4.Qe5+ forks.
* 3...Rh7 4.Qe5+ Ka8 (4...Ka7 changes nothing) 5.Qa1+ Kb8 6.Qb1+ forks.
Once the rook is lost, the result is a basic checkmate (king and queen against king), which is easily won.
White should not close in further once the Philidor position has been achieved. For 1.Qa6 runs into 1...Rc7+ and White must retreat the king to d6, for 2.Kb6? Rc6+! forces a draw.

### Second-rank defense

| | a | b | c | d | e | f | g | h | |
| 8 | | | | | | | | | 8 |
| 7 | | | | | | | | | 7 |
| 6 | | | | | | | | | 6 |
| 5 | | | | | | | | | 5 |
| 4 | | | | | | | | | 4 |
| 3 | | | | | | | | | 3 |
| 2 | | | | | | | | | 2 |
| 1 | | | | | | | | | 1 |
| | a | b | c | d | e | f | g | h | |
In the last stages of the defense, Black often places their rook on the second rank. White's goal is thus to create Philidor's position, which involves getting their king on the sixth rank. Black's only way of posing some challenge to this is to have their king on the second rank. Black is closest to defeat when their king is forced into the corner.
The diagram to the right illustrates a typical second-rank defense. White will try to drive the enemy king into the corner.
    1.Qf5+ Kd8 2.Kc5
2.Kc6 also theoretically wins just as quickly, but it allows Black to escape into a practically problematic third-rank defense with 2...Re6+.
Now Black has a few options:
    (A) 2...Kc7 3.Qd5 Rd7
If 3...Re1, then 3.Qd6+ Kc8 4.Qa6+ Kb8 5.Qb5+ Kc8 6.Qc4 keeps the rook away from its king, and soon it will be forked: 6...Kc7 7.Qf4+ Kc8 8.Qg4+ Kd8 9.Qh4+.
    4.Qe5+ Kb7 5.Kb5 Rc7 6.Qe8 Ka7
Likewise 6...Rc1 7.Qe4+ Kc8 8.Kb6 Kd7 9.Qd3+ Kc8 10.Qf5+ Kd8 (10...Kb8 11.Qe5+ Kc8 12.Qe8#) 11.Qg5+ forks.
    7.Qe4 Rb7+ 8.Kc6 Ka8 9.Qd5 Ka7 10.Qd8
Philidor's position has been reached.
    (B) 2...Re1 3.Qd3+ Ke7 4.Kd5 Kf7 5.Qf3+ Ke7 6.Qg4 Kf7 7.Qf4+ Ke8 8.Kd6 Rd1+ 9.Ke6 Re1+ 10.Kf6
The rook is lost.
    (C) 2...Ke8 3.Qc8+ Kf7 4.Kd6 Ra7
If 4...Re8, then 5.Qd7+ Kf8 6.Qh7 Re1 7.Qh6+ Kg8 8.Qg5+ Kf7 9.Qf4+ Ke8 10.Qg3 and White wins.
    5.Qc4+ Kf8 6.Ke6 Ra1
6...Rh7 does not help, because after 7.Qc8+ White will use queen checks to get their queen to f7, forcing ...Kh6, which will lose to Qf6+ followed by Kf5.
    7.Qf4+
7.Qc5+ also works: the motif after 7...Kg8 8.Kd5, with king and queen lining up against the enemy king, is common. There would then follow 8...Rg7 (if 8...Kg7, then 9.Qg5+ Kf8 10.Qh5) 9.Kf6 Kh7 10.Qh1+ Kg8 11.Qh5 and Philidor's position is reached.
    7...Ke8 8.Kd6 Rd1+ 9.Ke6 Re1+ 10.Kf6
The rook is lost.
| Diagram 1 abcdefgh8877665544332211abcdefghWhite to play and win (Berger 1889) | Diagram 2 abcdefgh8877665544332211abcdefghWhite to play and win (Nunn 2002) |
The stronger side must remain alert to stalemating possibilities from the weaker, which are quite common tries for defense. In diagram 1, 1.Qc6+ is actually a mistake delaying mate, because after 1...Kb8, the penetration to the sixth rank with 2.Kb6? falls into 2...Ra6+ and stalemate. Instead 1.Qe5 and 1.Qd4 both win quickly and allow this penetration.
Nunn calls attention to a tactic in diagram 2, noting that it is "not obvious": after 1.Qd8 Kh7, it is good to play 2.Qd4 covering g7, so that after 2...Rg7+ 3.Kf6 Rg6+ 4.Kf7 Black will no longer be able to check.
Generally, moving the rook away from the king loses quickly. The queen plays two roles in breaking down the second-rank defense; it restricts the enemy king's movement and prevents the enemy rook from checking its king from behind. This allows its king to penetrate through to the sixth rank. If the rook is cut off from the king, it is usually better for the queen to stop it from checking, rather than continue its own checking. Thus, if it were Black's move in diagram 2, Nunn recommends responding to 1...Rf1 with 2.Qe5+ Kf7 3.Qe3.

### Third-rank defense

| | a | b | c | d | e | f | g | h | |
| 8 | | | | | | | | | 8 |
| 7 | | | | | | | | | 7 |
| 6 | | | | | | | | | 6 |
| 5 | | | | | | | | | 5 |
| 4 | | | | | | | | | 4 |
| 3 | | | | | | | | | 3 |
| 2 | | | | | | | | | 2 |
| 1 | | | | | | | | | 1 |
| | a | b | c | d | e | f | g | h | |
Müller and Lamprecht note that it is very difficult to see the right winning plan here without knowing it beforehand. Nunn concurs, drawing a distinction between breaking down the second-rank defense (which he considers a strong player likely able to calculate over the board), versus breaking down the third-rank defense (where he considers that the winning method must be known beforehand). This is especially so because the defense is easy for Black to hold if White does not know what they are doing; it simply involves keeping the rook on the third rank. It is sufficient to know how to solve two positions: the one diagrammed to the right, and the same one with the rook on a6 instead.
    1.Qf4
This move, bringing the queen away from a position that looks so dominating, guarantees success. (There are other methods, but all involve some sort of counterintuitive move like this one.) Now there is no safe square for the rook on the third rank, so Black has to move the king.
    1...Kd7 2.Qa4+
This is the point, allowing the queen to switch to the other side of the board with tempo.
    2...Kc7 3.Qa7+ Rb7 4.Qc5+
Black is forced into a second-rank defense, as would also happen after 2...Kc8 3.Kc5 Rb7, or 1...Kc8 2.Kc5 Ra6 3.Qe4 Kc7 4.Qe7+ Kb8 5.Kb5 Ra7.
With the rook on a6 rather than b6, White's task is easier: 1.Kc5 Kc8 2.Qe7 Kb8 3.Kb5 Ra7.

### Fourth-rank defense

| | a | b | c | d | e | f | g | h | |
| 8 | | | | | | | | | 8 |
| 7 | | | | | | | | | 7 |
| 6 | | | | | | | | | 6 |
| 5 | | | | | | | | | 5 |
| 4 | | | | | | | | | 4 |
| 3 | | | | | | | | | 3 |
| 2 | | | | | | | | | 2 |
| 1 | | | | | | | | | 1 |
| | a | b | c | d | e | f | g | h | |
This is relatively easy to force the defending side out of, resulting in a third-rank or second-rank defense.
    1.Qf7+
It is best to avoid 1.Kd4 Ra1, where Black puts the rook on the same diagonal as White's king and threatens to check from two directions. White would then have to lose time and find several difficult moves: 2.Qf7+ Kd6 3.Qb3 (denying d1 and a4 to the rook) 3...Ke7 4.Qc3 Ra6 5.Qc7+ Kf6 6.Qd8+ and 7.Ke5 will force Black into a third-rank defense.
Now Black has two paths:
    (A) 1...Kd8 2.Qe6 Kc7 3.Kd3
White should try to get their king to b4, so that Black's rook must leave the fourth rank. But 3.Kd4 is avoided, because of the diagonal motif with 3...Ra1.
    3...Rc5
If 3...Ra4, then 4.Qe7+ Kb6 5.Qd6+ Kb5 6.Qd5+ Ka6 7.Qc5 Ra5 8.Qc6+ Ka7 9.Kc4 and attempting a smaller diagonal motif with 9...Ra2 does not help, because 10.Qf6 Ra5 11.Kb4 Ra6 12.Qd4+ and Kb5 will result in a White win. In general, diagonal motifs only work well when the rook is at least three squares away from the White king; otherwise, it is not hard for White to force Black to retreat.
    4.Kd4 Rc1
4...Rc6 would retreat into a third-rank defense: 5.Qe7+ Kb6 6.Kd5.
    5.Qe3 Rc6
A third-rank defense follows with 6.Qe7+ Kb6 7.Kd5. If instead 5...Rd1+, then 6.Kc5 Rd7 and Black enters a second-rank defense.
    (B) 1...Kd6 2.Qe8
This covers the a4 square.
    2...Kc7
If 2...Kc5, then White can as in line (A) try to get their king to b4 with 3.Qe5+ Kb6 4.Qd6+ Kb7 5.Kd3. If 2...Rc5, then White can force Black into a second-rank defense with 3.Qd8+ Kc6 4.Kd4 Rb5 5.Qc8+ Kb6 6.Kc4 Ka7 7.Qd7+ Rb7 8.Qd4+ Kb8 9.Kc5.
    3.Qe6
White's plan is to force Black's king to go to the next file to the left, and penetrate with their own king to b4. This will force Black's rook to abandon the fourth rank.
    3...Rb5
3...Rc5 4.Kd4 transposes to line (A).
    4.Kd4
Nunn singles this out as "the trickiest moment": it allows a shorter (and less effective) diagonal motif, but this cannot be averted because 4.Kd3 runs into 4...Rb1. White threatens Kc4.
    4...Rb2
If 4...Rb6, then White forces a second-rank defense with 5.Qe7+ Kc6 6.Kc4 Rb7 7.Qe6+.
    5.Kc3 Rb7
Black is forced back into a second-rank defense. There could follow 6.Kc4 Kd8 7.Qg8+ Kd7 8.Kc5 Rc7+ 9.Kd5.

### Drawn positions

Discounting the possibilities of immediately winning the queen, there are a few positions where the rook can draw because the poor placement of the enemy pieces permits stalemate-related tactics.
Diagram 1 is a draw, because the rook can give a perpetual check from f7, g7, and h7. The White king cannot cross to the e-file (because the queen would be lost to a pin), and the rook is immune to capture on h7 or g6 (e.g. 1...Rg7+ 2.Kf6 Rg6+! forces a draw) because stalemate would result. Likewise diagram 2 permits a draw by perpetual check from g7 and h7, because the White king cannot cross to the f-file and cannot capture the rook on h6. (It would still be drawn by perpetual check with the queen on f1 through f4, but it is won with the queen on f5 by the plan of getting the White king to h6, which no longer causes stalemate.) Finally, diagram 3 has the defending king immobilised in the corner by the enemy queen a knight's move away, so the rook may give perpetual check along the g-file (being immune on g6) or the first rank. Otherwise the checks will come to an end and the position is lost.

## Example games
### Morozevich vs Jakovenko 2006

Even grandmasters sometimes fail to properly execute the winning technique, as demonstrated by this 2006 game between Alexander Morozevich and Dmitry Jakovenko.
| | a | b | c | d | e | f | g | h | |
| 8 | | | | | | | | | 8 |
| 7 | | | | | | | | | 7 |
| 6 | | | | | | | | | 6 |
| 5 | | | | | | | | | 5 |
| 4 | | | | | | | | | 4 |
| 3 | | | | | | | | | 3 |
| 2 | | | | | | | | | 2 |
| 1 | | | | | | | | | 1 |
| | a | b | c | d | e | f | g | h | |
Notes based on those by David Smerdon.
    72...Rd5! 73.Ke6 Rd4 74.Ke5 Rd3 75.Qc2 Rd8!
Black is trying to stop the White king from penetrating using a fourth-rank defense (though the board is rotated 90 degrees here). Here this requires him to move his rook away; such a decision requires calculation, to not fall victim to a series of checks leading to a fork picking up the rook.
    76.Qb3+ Kc5 77.Qc3+ Kb5 78.Ke6 Kb6 79.Qc4!
After 79...Kb7 80.Ke7!, the rook would have to leave the d-file.
    79...Rg8!
A standard motif, going to the diagonal the White king is on in order to avoid getting forked.
    80.Qd4+ Kc6 81.Qc3+
81.Ke7! is much better.
    81...Kb5 82.Kd6 Rg6+ 83.Kc7 Rg4!!
The most tenacious defenses often require moving the rook away from the king in such a way that it will be safe from forks. In this case, Black is safe, because he can either move his king on the dark squares or block checks with his rook.
    84.Qc6+ Kb4 85.Qd6+ Kc3 86.Kc6 Rd4 87.Qa3+ Kd2 88.Kc5 Re4!
Reforming a fourth-rank defense.
    89.Kd5 Rg4 90.Qf3 Rb4 91.Kc5 Ra4! 92.Qf6 Kd3 93.Qd6+ Ke3 94.Qg3+ Ke2 95.Qc3 Rf4! 96.Kd5 Rg4 97.Ke5 Rh4 98.Kf5 Kf2 99.Qd3!
The fourth-rank defense is broken.
    99...Rh7!
Again the diagonal motif.
    100.Qd4+ Kf3 101.Kg5!
The moves that are best at making progress for White are often non-checks.
    101...Rh2!
Forming a second-rank defense.
    102.Qf4+ Kg2 103.Qg4! Kg1 104.Qd4+ Kg2 105.Qd3 Kg1 106.Qe3+ Kf1 107.Qc1+ Kf2 108.Qd2+ Kg1 109.Qe1+ Kg2 (diagram)
| | a | b | c | d | e | f | g | h | |
| 8 | | | | | | | | | 8 |
| 7 | | | | | | | | | 7 |
| 6 | | | | | | | | | 6 |
| 5 | | | | | | | | | 5 |
| 4 | | | | | | | | | 4 |
| 3 | | | | | | | | | 3 |
| 2 | | | | | | | | | 2 |
| 1 | | | | | | | | | 1 |
| | a | b | c | d | e | f | g | h | |
Now White should play 110.Qe5! Kg1 111.Kg3! Rg2+ 112.Kh3! and the rook is lost.
    110.Qg3+?!
This check, though natural, does not form part of the winning plan.
    110...Kh1 111.Kf3??
111.Qe5 would still have won. This is the decisive mistake.
    111...Rf2+!!
Stalemate will be forced.
    112.Ke3 Re2+ 113.Kd3 Rd2+ 114.Kxd2 ½–½

### Hannes vs Müller 1992

This was a rather accurately executed win by Hannes Stefánsson over Karsten Müller. The notes are based on those by Nunn.
| | a | b | c | d | e | f | g | h | |
| 8 | | | | | | | | | 8 |
| 7 | | | | | | | | | 7 |
| 6 | | | | | | | | | 6 |
| 5 | | | | | | | | | 5 |
| 4 | | | | | | | | | 4 |
| 3 | | | | | | | | | 3 |
| 2 | | | | | | | | | 2 |
| 1 | | | | | | | | | 1 |
| | a | b | c | d | e | f | g | h | |
    72.Qb4+ Kd5 73.Kg4 Rf6 74.Qe7
This wastes four moves. After 74.Qb5+ Kd6 75.Kg5 Re6 76.Kf5 Re7 77.Qb6+ Kd7 78.Kf6 Kc8 79.Qa6+ Rb7 80.Ke6, White is well into breaking down the second-rank defense.
    74...Re6 75.Qb7+ Kd4 76.Qd7+ Ke5 77.Kg5
Again wasting three moves. Similarly to the previous note, better would have been to chase Black to the first rank with 77.Qb5+ Kd4 78.Kf5 Re3 79.Qb4+ Kd3 80.Qf4.
    77...Rd6 78.Qe7+ Kd5 79.Kf5
White does not always take the fastest win, but he plays quite precisely and logically.
    79...Rc6 80.Qd7+ Kc5 81.Ke5 Kb6
Settling for a third-rank defense.
    82.Qd4+ Kb7
Black could have held out five moves longer with 82...Kb5; in general, it is better for the defending king to be near an edge than a corner.
    83.Kd5 Rc7 84.Qb4+ Kc8
Black has been forced into a second-rank defense.
    85.Qb5
A quicker win is 85.Qa4 Rd7+ 86.Kc6 Rc7+ 87.Kd6 Kb8 88.Qe8+ Rc8 89.Qb5+ Ka7 90.Kd7.
    85...Rh7 86.Qe8+ Kb7 87.Kc5 Rc7+ 88.Kb5 Ka7 89.Qe4
Nunn singles this move out as "excellent".
    89...Rb7+ 90.Kc6 Ka8 91.Qe8+ Ka7 92.Qd8
White reaches Philidor's position.
    92...Rb1 93.Qe7+
A quicker win is 93.Qd4+.
    93...Kb8 94.Qf8+ Ka7 95.Qf2+ Kb8 96.Qh2+ Ka7 97.Qa2+ Kb8 98.Qxb1+ Kc8 99.Qb7+ Kd8 100.Qd7# 1–0

## Larger boards

The winning procedure when the king and rook are widely separated is quite ad hoc, and the ending of queen versus rook is not generally won on larger boards. Marc Bourzutschky showed that it is generally won on square boards only from 5×5 to 15×15: on a 16×16 board, the defenders can sometimes run away forever. Even on a 12×8 board, the Philidor position is already much more complicated if Black moves the rook the furthest possible distance, though the ending is still a general win in this case.

## Queen versus rook and pawn

| Diagram 1 abcdefgh8877665544332211abcdefghWhite to play and draw (Müller and Lamprecht 2001) | Diagram 2 abcdefgh8877665544332211abcdefghReciprocal zugzwang (Grigoriev 1933) |
There is a drawing fortress involving a non-rook's pawn on the second rank next to its king and rook. The attacker cannot make progress because their king cannot get behind the pawn. The rook should shuttle back and forth between the squares protected by the pawn, and the king should stay near its pawn. For example, in Diagram 1, White can play 1.Rg3 Ke4 2.Re3+ Kf4 3.Rg3 Qc6+ 4.Kg1 and Black cannot make any progress. (This position would still be a draw even with a Black pawn on g4 or h4.) However, getting the rook to the correct position can pose significant difficulties. If the superior side can block the pawn with their king, and the pawn has not crossed the middle line, then they win. The superior side also has winning chances if their king crosses the sixth rank, even if the inferior side has successfully set up the fortress.
A central or bishop's pawn would lose on the third through fifth ranks, because now the enemy king can get behind the pawn. But the knight's pawn still draws even as far as the fifth rank, because there is no room for the queen on the short side of the pawn. If the pawn reaches the sixth or seventh rank, the drawing chances increase. Diagram 2 is a reciprocal zugzwang: Black to play draws, but White to play loses. (The defender has better chances if his king remains on the lower ranks, which forecloses zugzwang possibilities from the attacker.)
A rook's pawn loses on the second rank, because the rook has only one protected square to use. To win against a rook's pawn on the third rank, it is necessary for the attacking king to advance on the pawn's own file from ahead; if this cannot be achieved, then the defending king cannot be forced out of the corner. The defender should stop the attacking king from penetrating to B7 and B8 (descriptive notation). The defender loses with a rook's pawn on the fourth or fifth rank, because they cannot successfully defend all the squares behind the pawn.

## More pawns

In the case where both rook and queen are supported by pawns, the rook has the best drawing chances if all the pawns are on one side of the board and the rook has a secure outpost. The queen has much higher chances to win if the pawns are on both sides of the board.