Local variations in castling rules were common, however, persisting in Italy until the late 19th century.
Illegal castling has also occasionally occurred in serious games between top players (including Gata Kamsky, Viktor Korchnoi, and Richard Réti) when they forgot that the king or rook had previously moved and returned to its home square, and has not always been noticed by the opponent.
[7] To clarify: Under FIDE rules and USCF rules, and enforced in most tournaments, castling is considered a king move, so the king must be touched first; if the rook is touched first, a rook move must be played instead.
As usual, the player may choose another legal destination square for the king until releasing it.
In a 1986 game between Anatoly Karpov and Tony Miles,[11] play continued from the diagrammed position as follows: With his 26th move, Karpov attempted to claim a draw by threefold repetition, thinking that the positions after his 22nd, 24th, and 26th moves were the same.
... Ra4, meaning Black still had castling rights in that position), rendering his claim illegal.
[12] Various forms of castling were developed due to the spread of rulesets during the 15th and 16th centuries which increased the power of the queen and bishop, allowing these pieces to attack from a distance and from both sides of the board, thus increasing the importance of king safety.
The choice regarding to which side one castles often hinges on an assessment of the trade-off between king safety and activity of the rook.
In positions where the opponent cannot organize an attack against a centralized king, castling may be unnecessary or even detrimental.
In addition, in certain situations, a rook can be more active near the edges of the board than in the center; for example, if it is able to fight for control of an open or semi-open file.
After 1.Qxd8+ Kxd8 2.0-0-0+ Ke7 3.Nxb5, White has won a rook by castling with check and simultaneously unpinning the knight.
In this position from the blindfold game Karjakin–Carlsen, 2007, the move 19...0-0 threatens to win the rook on h7, as well as 20...Bxg5, when White cannot recapture due to the threat of back rank mate.
[22] The arbiter answered in the affirmative, Korchnoi executed the move, and Karpov resigned shortly after.
Averbakh's colleague Vladimir Bagirov then explained the castling rules to him in Russian, and the game continued.
The diagram shows the final position of the game Lodewijk Prins–Lawrence Day (1968), where White resigned.
In the 1934 Belgian Championship,[32] Otto Feuer caught Albéric O'Kelly in the Thornton castling trap.
[33] Although all the pieces were now on the same squares, the two positions were not identical because Black, having moved his king, no longer had the right to castle.
In the first diagram (arising from the Ruy Lopez, Classical Defence): Black sees that if he plays 1...Nxe5, White responds with 2.d4, winning back the minor piece with a fork and taking control of the center.
Variants of Western chess often include castling in their rulesets, sometimes in a modified form.
This includes variants that replace the king with a different royal piece, as is the case with the knight in Knightmate.
Some variants, however, have different rules; for example, in Chess960, the king may move more or fewer than two squares (including none) when castling, depending on the starting position.
[39] In 2021, former world champion Viswanathan Anand defeated Kramnik 2½–1½ in a no-castling exhibition match under classical time controls.
[42] In some retrograde analysis problems, the solver (who usually plays White) is required to prove that the opponent has previously moved their king or rook and therefore cannot castle.
This is sometimes accomplished by castling or by capturing en passant, thereby disproving other possible game histories.
[43] Some joke chess problems involve castling with a promoted rook of the opponent's color.
The allowance of castling with a "phantom rook" in handicap games has also been used in joke problems.
In the position on the right, White plays 1.e8=R, and after the forced move 1...Kxc2 castles vertically with the promoted rook, checkmating Black.
[46][47] Tim Krabbé's 1985 book Chess Curiosities includes a problem featuring vertical castling, along with an incorrect claim that the problem's 1973 publication prompted FIDE to amend the castling laws in 1974 to add the requirement that the king and rook be on the same rank.
In reality, the original FIDE Laws from 1930 explicitly stated that castling must be done with a king and a rook on the same rank (traverse in French).
In most European languages, the term for castling is derived from the Persian rukh (e.g. rochieren, rochada, enroque), while queenside and kingside castling are referred to using the adjectives meaning "long" and "short" (or "big" and "small"), respectively.