Answers.Body: <p>According to that <a href="http://gadycosteff.com/cql" rel="nofollow noreferrer">CQL</a> query :</p>
  <pre><code>cql(input Megabase2023.pgn)
  
  mate
  move previous from [Kk] o-o-o
  </code></pre>
  <hr />
  <p><a href="https://gist.github.com/signed-log/f8e2064411a514859148583d815e7283" rel="nofollow noreferrer">15 games</a> had queen side castle deliver checkmate, including 5 by 2000+ players</p>
  <hr />
  <pre><code>[Title &quot;Vlassov, Nikolai (2466) v. Wirig, Anthony (2422) - EU-ch Internet qual (2003, blitz) - Playchess.com&quot;]
  [FEN &quot;&quot;]
  
  1.e4 c6 2.d4 d5 3.e5 Bf5 4.Nc3 Qb6 5.Nf3 e6 6.Bd3 Bxd3 7.
  Qxd3 Qa6 8.Qxa6 Nxa6 9.a3 c5 10.Be3 h6 11.Nb5 Kd7 12.dxc5 Nxc5 13.b4 a6 14.Nc3
  Ne4 15.Nxe4 dxe4 16.Nd2 a5 17.Nc4 Kc6 18.Nxa5+ Kd5 19.Bf4 g5 20.O-O-O#
  </code></pre>
  <hr />
  <pre><code>[Title &quot;Heimisson, Hilmir Freyr (2394) v. Fossan, Andreas (2025) - Nordic-ch U20 (2019)&quot;]
  [FEN &quot;&quot;]
  
  1.e4 c6 2.Nc3 d5 3.Qf3 d4 4.Bc4 e6 5.Nce2 Ne7 6.Qg3 a5 7.
  a3 b5 8.Ba2 Bb7 9.d3 Ng6 10.h4 Bd6 11.f4 Rg8 12.Nf3 Na6 13.h5 Ne7 14.Nexd4 Nc7
  15.Be3 c5 16.Ne2 Nc6 17.Qf2 Na6 18.h6 Qc7 19.e5 Be7 20.Nc3 Qb6 21.f5 exf5 22.
  Bxf7+ Kxf7 23.Ng5+ Bxg5 24.Qxf5+ Bf6 25.exf6 gxf6 26.Qxh7+ Ke6 27.Nd5 Kxd5 28.
  Qf7+ Ke5 29.Rh5+ Rg5 30.Bf4+ Kxf4 31.Qxf6+ Kg3 32.Rh3+ Kxg2 33.Qf3+ Kg1 34.
  O-O-O#
  </code></pre>
  <hr />
  <pre><code>[Title &quot;Garcia, Alvaro (2231) v. Gonzalez Parejo, Ramon Junior (2067) - COL-ch sf Medellin (2019)&quot;]
  [FEN &quot;&quot;]
  
  1.d4 Nf6 2.c4 g6 3.Nc3 Bg7 4.e4 d6 5.Nge2 c5 6.d5 O-O 7.
  Ng3 Bg4 8.f3 Bd7 9.h4 Na6 10.h5 Nc7 11.Bf4 a6 12.Qd2 b5 13.Bh6 bxc4 14.Bxg7
  Kxg7 15.hxg6 fxg6 16.Qh6+ Kg8 17.Bxc4 Nb5 18.e5 dxe5 19.Nge4 Rf7 20.Nxf6+ exf6
  21.d6 Nxd6 22.Qxh7+ Kf8 23.Qh8+ Ke7 24.Nd5+ Ke6 25.Nf4+ Kf5 26.g4+ Kxf4 27.Qh2+
  Ke3 28.Qd2+ Kxf3 29.Rh3+ Kxg4 30.Qg2+ Kf4 31.Rf3+ Ke4 32.Qe2+ Kd4 33.O-O-O#
  </code></pre>
  <hr />
  <pre><code>[Title &quot;Van Riemsdijk, Dirk Dagobert (2137) v. Queiroz, Stella Becker - Santos Paulista-ch (2011)&quot;]
  [FEN &quot;&quot;]
  
  1.e4 c6 2.Nc3 d5 3.Qf3 d4 4.Bc4 dxc3 5.Qxf7+ Kd7 6.dxc3
  b5 7.Bf4 bxc4 8.O-O-O#
  </code></pre>
  <hr />
  <pre><code>[Title &quot;Kablar, Dorian (1538) v. Hilby, Craig (2420) - Kasparov CF University Cup (Lichessm rapid, 2022)&quot;]
  [FEN &quot;&quot;]
  
  1.e4 e5 2.Nf3 Nc6 3.Bc4 Bc5 4.Nc3 Nf6 5.d3 d6 6.Bg5 h6 7.
  Bh4 a6 8.O-O g5 9.Bg3 Na5 10.Bb3 Nxb3 11.axb3 h5 12.h3 h4 13.Bh2 g4 14.hxg4
  Bxg4 15.Qd2 h3 16.Bg3 Nh5 17.Kh2 hxg2 18.Kxg2 Bh3+ 19.Kxh3 Nf4+ 20.Kg4 Qd7+ 21.
  Kg5 Nh3+ 22.Kf6 Qe6+ 23.Kg7 Qg6+ 24.Kxh8 O-O-O#
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-02-25T00:02:00.710Z
Answers.Text: It might also be worth mentioning the famous Lasker–Thomas game which *almost* ended in O-O-O# except that Edward Lasker chose to move his king instead.
Answers.UserDisplayName: bof
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-02-25T09:15:45.080Z
Answers.Text: What is the tool used for the script?
Answers.UserDisplayName: Thorbjørn Ravn Andersen
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-02-25T09:17:24.023Z
Answers.Text: [CQL](http://gadycosteff.com/cql) running on the ChessBase Megabase 2023 @ThorbjørnRavnAndersen
Answers.UserDisplayName: Nicolas Formichella
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-02-25T09:19:48.503Z
Answers.Text: @NicolasFormichella Thank you.  New toy for me 
Answers.UserDisplayName: Thorbjørn Ravn Andersen
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-02-25T10:19:28.347Z
Answers.Text: Is there any indication that this move came out of the blue and totally blindsided the player/s beaten?
Answers.UserDisplayName: Valorum
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-02-25T11:07:43.327Z
Answers.Text: @Valorum In all five games simply moving the rook or king would have resulted in a checkmate too, so there was nothing special about the castle that would have surprised the opponent. It would be interesting finding a game where the castle was the only possible checkmate (maybe a case where three pieces in front of the king would make moving it to discover the rook impossible)
Answers.UserDisplayName: LordHieros
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-02-25T11:29:16.833Z
Answers.Text: Link for the Lasker-Thomas game: https://www.chessgames.com/perl/chessgame?gid=1259009
Answers.UserDisplayName: Ian Bush
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-02-25T13:33:09.743Z
Answers.Text: @bof The Lasker game always make me sad for a missed opportunity.   I understand Lasker preferred to move his King because it is "more efficient" as only one piece is moved.
Answers.UserDisplayName: Michael West
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-02-25T14:15:41.013Z
Answers.Text: @Valorum These games ended with OOO but there was at least one other checkmating move. Rook obviously can always move to the final square. But there are possible scenarios where the king cannot move from his rank to deliver checkmate (simplest: white has Ra1, Ra2, black has Rh2, king on g1/h1). There is even a possibility that both the king and the rook had to move to checkmate - black king on d3 and the white king preventing move to c2. Say with Ng3, Bd4 and b3. I doubt either of these two options happened in a serious game.
Answers.UserDisplayName: Zizy Archer
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-02-24T21:36:32.663Z
Answers.LastActivityDate: 2023-02-25T09:16:57.073Z
Answers.LastEditDate: 2023-02-25T09:16:57.073Z
Answers.UserDisplayName: Nicolas Formichella
Body: <p><em>This is to complement the <a href="https://chess.stackexchange.com/q/41659/34197">kingside</a> variant of that question</em></p>
  <p>Has checkmate ever been achieved by a castling queen side in a high-level game?</p>
  
Tags: <history><checkmate><castling><famous-games><master-games>
Title: Has checkmate ever been achieved by castling queenside in a high-level game?
ThreadText: # Has checkmate ever been achieved by castling queenside in a high-level game?
  
  (Asked by: username_0 on 2023-02-24)
  
  *This is to complement the [kingside](https://chess.stackexchange.com/q/41659/34197) variant of that question*
  
  Has checkmate ever been achieved by a castling queen side in a high-level game?
  
  **Tags:** history, checkmate, castling, famous-games, master-games
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_0 on 2023-02-24. Score: 9 | Accepted answer
  
  According to that CQL query :
  cql(input Megabase2023.pgn)
  
  mate
  move previous from [Kk] o-o-o
  
  
  15 games had queen side castle deliver checkmate, including 5 by 2000+ players
  
  [Title "Vlassov, Nikolai (2466) v. Wirig, Anthony (2422) - EU-ch Internet qual (2003, blitz) - Playchess.com"]
  [FEN ""]
  
  1.e4 c6 2.d4 d5 3.e5 Bf5 4.Nc3 Qb6 5.Nf3 e6 6.Bd3 Bxd3 7.
  Qxd3 Qa6 8.Qxa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 30.Qg2+ Kf4 31.Rf3+ Ke4 32.Qe2+ Kd4 33.O-O-O#
  
  
  [Title "Van Riemsdijk, Dirk Dagobert (2137) v. Queiroz, Stella Becker - Santos Paulista-ch (2011)"]
  [FEN ""]
  
  1.e4 c6 2.Nc3 d5 3.Qf3 d4 4.Bc4 dxc3 5.Qxf7+ Kd7 6.dxc3
  b5 7.Bf4 bxc4 8.O-O-O#
  
  
  [Title "Kablar, Dorian (1538) v. Hilby, Craig (2420) - Kasparov CF University Cup (Lichessm rapid, 2022)"]
  [FEN ""]
  
  1.e4 e5 2.Nf3 Nc6 3.Bc4 Bc5 4.Nc3 Nf6 5.d3 d6 6.Bg5 h6 7.
  Bh4 a6 8.O-O g5 9.Bg3 Na5 10.Bb3 Nxb3 11.axb3 h5 12.h3 h4 13.Bh2 g4 14.hxg4
  Bxg4 15.Qd2 h3 16.Bg3 Nh5 17.Kh2 hxg2 18.Kxg2 Bh3+ 19.Kxh3 Nf4+ 20.Kg4 Qd7+ 21.
  Kg5 Nh3+ 22.Kf6 Qe6+ 23.Kg7 Qg6+ 24.Kxh8 O-O-O#
  
  > **Comments:**
  > **username_1**: It might also be worth mentioning the famous Lasker–Thomas game which *almost* ended in O-O-O# except that Edward Lasker chose to move his king instead.  
  > **username_2**: What is the tool used for the script?  
  > **username_0**: [CQL](http://gadycosteff.com/cql) running on the ChessBase Megabase 2023 @ThorbjørnRavnAndersen  
  > **username_2**: @NicolasFormichella Thank you.  New toy for me   
  > **username_3**: Is there any indication that this move came out of the blue and totally blindsided the player/s beaten?  
  > **username_4**: @username_3 In all five games simply moving the rook or king would have resulted in a checkmate too, so there was nothing special about the castle that would have surprised the opponent. It would be interesting finding a game where the castle was the only possible checkmate (maybe a case where three pieces in front of the king would make moving it to discover the rook impossible)  
  > **username_5**: Link for the Lasker-Thomas game: https://www.chessgames.com/perl/chessgame?gid=1259009  
  > **username_6**: @username_1 The Lasker game always make me sad for a missed opportunity.   I understand Lasker preferred to move his King because it is "more efficient" as only one piece is moved.  
  > **username_7**: @username_3 These games ended with OOO but there was at least one other checkmating move. Rook obviously can always move to the final square. But there are possible scenarios where the king cannot move from his rank to deliver checkmate (simplest: white has Ra1, Ra2, black has Rh2, king on g1/h1). There is even a possibility that both the king and the rook had to move to checkmate - black king on d3 and the white king preventing move to c2. Say with Ng3, Bd4 and b3. I doubt either of these two options happened in a serious game.  
  
  ---
  
  