user1342: I am new to chess.  Please answer this for me:

Is it possible to castle with checkmate?


user19279: This was achieved by Eric Rosen (IM) on his Twitch stream, uploaded to YouTube Dec 2019.
https://www.youtube.com/watch?v=UxZc7ZF2uOY

user1413: If you I asking whether it is legal to castle out of checkmate if it is the only option then no the same rules apply as with check although I can't really think of many instances where you would be able to castle to prevent checkmate...

user1417: No-if check mate for your king.
Yes- if check mate for opponent's king

user167: I can think of two questions you might be meaning to ask, given the wording of your question. Maybe neither of these is what you're after, but just in case:
1. Is it possible to castle out of check or even checkmate? Here the answer is no. If your king is in check, then castling is not a legal move.
2. Is it possible to castle while checkmating your opponent? Here the answer is yes, it is possible, though it does not happen often. For instance, the game Ed.Lasker-Thomas (1912), with its famous queen sacrifice and king hunt, could have finished with a castling mate:
[fen ""]
1. d4 e6 2. Nf3 f5 3. Nc3 Nf6 4. Bg5 Be7 5. Bxf6 Bxf6 6. e4
fxe4 7. Nxe4 b6 8. Ne5 O-O 9. Bd3 Bb7 10. Qh5 Qe7 11. Qxh7+
Kxh7 12. Nxf6+ Kh6 13. Neg4+ Kg5 14. h4+ Kf4 15. g3+ Kf3
16. Be2+ Kg2 17. Rh2+ Kg1 18. Kd2# (18.O-O-O#)1-0


1342: <p>I am new to chess.  Please answer this for me:</p>

<blockquote>
  <p>Is it possible to castle with checkmate?</p>
</blockquote>
 19279: <p>This was achieved by Eric Rosen (IM) on his Twitch stream, uploaded to YouTube Dec 2019.
<a href="https://www.youtube.com/watch?v=UxZc7ZF2uOY" rel="nofollow noreferrer">https://www.youtube.com/watch?v=UxZc7ZF2uOY</a></p>
 1413: <p>If you I asking whether it is legal to castle out of checkmate if it is the only option then no the same rules apply as with check although I can't really think of many instances where you would be able to castle to prevent checkmate...</p>
 1417: <p>No-if check mate for your king.
Yes- if check mate for opponent's king</p>
 167: <p>I can think of two questions you might be meaning to ask, given the wording of your question. Maybe neither of these is what you're after, but just in case:</p>

<p><strong>1. Is it possible to castle out of check or even checkmate?</strong> Here the answer is <em>no</em>. If your king is in check, then castling is not a legal move.</p>

<p><strong>2. Is it possible to castle while checkmating your opponent?</strong> Here the answer is <em>yes</em>, it is possible, though it does not happen often. For instance, the game <a href="http://www.chessgames.com/perl/chessgame?gid=1259009">Ed.Lasker-Thomas (1912)</a>, with its famous queen sacrifice and king hunt, could have finished with a castling mate:</p>

<pre><code>[fen ""]
1. d4 e6 2. Nf3 f5 3. Nc3 Nf6 4. Bg5 Be7 5. Bxf6 Bxf6 6. e4
fxe4 7. Nxe4 b6 8. Ne5 O-O 9. Bd3 Bb7 10. Qh5 Qe7 11. Qxh7+
Kxh7 12. Nxf6+ Kh6 13. Neg4+ Kg5 14. h4+ Kf4 15. g3+ Kf3
16. Be2+ Kg2 17. Rh2+ Kg1 18. Kd2# (18.O-O-O#)1-0
</code></pre>
