With a rook, the king may make a special move called 'castling'. This is when the king moves two squares toward one of its rooks and then the rook is placed on the other side of the king. Castling consists of moving the king two squares on its first rank toward either one of the first rooks, then moving the rook onto the square over which the king crossed. Castling is only allowed when the king nor the castling rook has moved already, when no squares between them are occupied, when the king is not in check, and when the king will not move across or end its movement on a square that puts the king in check.