Can You Castle Out of Check? 

can you castle out of check

I remember playing a very weird chess game with my little sister. It was a rainy day, and we sat with our chessboard and hot chocolate. The odd part was the game never ended because I simply castled every time my king was under check.

Now that I recall, I think my sister did the same. So, we kept playing similar moves until it got dark and mom forced us to end the game.

If you think about our weird game, there’re two obvious questions. One, can you castle out of check? Second, what happens when you keep repeating similar moves.

If you keep repeating your moves, it’s a draw by Three-fold repetition. To know more about it, read what is a draw. And to learn if you can castle out of check, keep reading further.

Desire to increase your rating?
EnthuZiastic Chess courses today to make your dreams come true.  

Can You Castle Out of Check?  

The answer is NO.

No, you can’t castle out of check. Castling is a defensive move, and using it while the king is in check is an illegal move. It is also illegal if you castle with two hands.

However, it’s okay to castle if the rook is in danger.

Can’t decide between kingside castling and queenside castling?
Read What is Castling in Chess to know all about castling.   

Why is Castling under Check an Illegal Move?  

Before I tell you why it’s illegal to castle under check, let me explain what an illegal move in chess is.

What is an Illegal Move?   

An illegal move is a move that breaks the standard rules of chess set by FIDE. The rules are majorly related to castling, pawn promotion, en passant, how to move chess pieces, how to behave while playing, etc.

How is it Illegal to Castle when the King is in Check?   

As per the rules by FIDE, you can’t castle “if the square on which the king stands, or the square which it must cross, or the square which it is to occupy, is attacked by one or more of the opponent’s pieces.” 

In simpler words, you can’t castle if your king is under check or it comes under check while moving or after moving to another square.

For instance, the Black king in the below image can’t castle. Why? Because the e8 square (on which the king is right now) is on check and d8 square (through which the king will travel for castling) is under attack. Therefore, the Black king can’t castle.

can you castle out of check?

If the Black king still castles, then it’s breaking the rules. Therefore, it’s an illegal move.

The next section is for beginner chess players who don’t know when their king is in check.

How do you know when the king’s in check?  

The king is ‘in check’ when it’s under attack by one or more of the enemy’s pieces.

when king is in check

Remember, your king is still in check even if the attacking pieces can’t move because it’s shielding their king.

For example, in the below picture, the white pawn on f3 attacking the Black king but it can’t move because it’s guarding its king. Even in such scenarios, it’s still a check. 

white pawn on f3

Now that you know when and how the king’s in check, always avoid castling in such situations.

However, if you still end up castling when your king’s under check by the enemy pieces, you’re making an illegal move.

Disclaimer: Let’s say making illegal moves in a chess game is like committing a crime under federal law.

Read the next section if you’re scared and want to know the consequences of illegal moves.

Did you know Egyptian Queen Nefertari played Chess? 
Read the History of Chess to find out..

What happens When You Castle under Check?   

Legal Information About Castling Illegally  

1. The consequence of First Illegal Move  

According to the laws of Chess, if you’re caught castling illegally, and it’s your first illegal move, the arbiter will declare the move invalid.

The pieces will be repositioned as per the last legal move recorded on the score-sheet. It means your king will be placed like before, following the chess notation written by you and your enemy player.  

In addition, the arbiter will provide 2 mins of extra time to your opponent player.

2. The consequence of Second Illegal Move  

If you end up moving illegally for the second time in the same game, the arbiter will do the same and give 2 mins extra to your opponent.

3. The consequence of Third Illegal Move  

If you’re caught moving illegally for the third time in a game of chess, even if it’s castling, the arbiter will declare your enemy as the winner of the game.

However, if there’s no legal possibility for your opponent to win, then the game will be declared a drawn game.

Legal Advice  

As you read in this section, there are actually no perks in illegally castling when the king’s under threat. It won’t be considered as a move, and at the same time, it will reduce your chance to win the game.

Therefore, I advise against castling when the king’s in check. DON’T CASTLE WHEN THE KING’S IN CHECK.

How to Castle under Check?   

If you’ve read What is Castling in Chess, you will learn why we castle in the first place.

One of the major reasons to castle is to shift the king to a safe square. Now, you might be thinking that why can’t we use castling when we need it the most–when the king is under attack.

Hold on.

Yes, you can castle in the hour of need but not straightaway.

First, you must get out of check and erase any chances for checkmate.

Get Out of Check by Blocking the Attacking Piece  

Try to move a piece in between your king and the attacking piece. But there’s a catch.

You can only block the attacking piece if it’s a queen, rook, or bishop. 

For instance, if you want to castle the white king and the rook in the below picture, then you must block the attacking black rook by placing the white knight on e3. 

can you castle out of check?

In contrast, unfortunately, there’s no hope for castling if attacking piece is a knight (as shown in the below picture). You can only afford to save the white king from checkmate. So, it’s a good idea to move it from the attacked square and shift it to a safe square.

no hope for castling if attacking piece is a knight

Remember, once you move your king, you can’t castle anymore.

Get-Out of Check by Capturing the Attacking Piece  

Capturing the attacking piece is the best way to get out of check in a chess game. Make sure not to leave your king under check once again.

Also, NEVER use the king to capture the attacking piece if you plan to castle in the next move.

NEVER use the king to capture the attacking piece

Why is the Rule of “No Castling When in-Check” Justified?   

Dear readers, as you know, castling is a special move. It’s the only move in which one can move two pieces at a time– the King and the rook.

So, castling becomes the most powerful move in a chess game. Let’s say it’s a game-changing move.

Moreover, if one could castle when in check, the whole dynamics of the game will become upside down.

As a result, the game might not remain as interesting as it is now. The moves will be repeated, either leading to a draw by threefold repetition or stalemate.

In other words, if you could castle while in-check, the game would continue like the weird chess game I played with my sister. There will be no meaningful direction in the chess game, and checkmate will become a far-fetched dream.  

Therefore, it’s always recommended to castle at the start of the game, as it’s a defensive move.


What are some advantages and disadvantages of trying to castle when under check?

When it comes to castling under check, there are mainly disadvantages because it’s an illegal move. However, there’s also an advantage if you can get out of check and then castle. Besides moving your king to a safe square, you will also attack or capture an opponent piece. So, here are a few perks of castling after your king has moved away from check.

What’s the reason one can’t castle while in check?

The main reason for not castling under check is because it’s against the rules set by FIDE. According to the laws of chess, one cannot castle if the king is standing on an attacked square.

If a chess player decides to play against the rules set by FIDE, it’s considered an illegal move.

Can you castle out of check?

No, you can’t castle out of check. As a matter of fact, you can’t castle as long as your king is under check.

learning piano

Learn Chess From Expert Teachers

Book a free demo class with one of our top teachers and start learning Chess


In my opinion, FIDE chess rules have their significance. Every rule has its role in making chess a better game than it was in the past.

As much as castling is vital in a chess game, it can also impact the chances for checkmate if allowed when in-check. It’s a defensive move and must not be used in the endgame.

Therefore, even though we would like to castle in the endgame, we must obey the rule.

To conclude, dear friends, play a legal game by making legal moves. Don’t try to castle when your king is in check. Let’s not embarrass ourselves.

Leave a comment