Chess originated from the Indian game Chaturanga, about 1400 years ago. It reached Russia via Mongolia, where it was played at the beginning of the 7th century. From India it migrated to Persia and mutated into the game of Shatranj, and spread throughout the Islamic world after the Muslim conquest of Persia. It was introduced into Spain by the Moors in the 10th century, where a famous games manuscript covering chess, backgammon, and dice named the Libro de los juegos, was written under the sponsorship of Alfonso X of Castile during the 13th century. Chess reached England in the 11th century, and evolved through various versions such as Courier. Before long pawns gained the option of moving two squares on their first move and the en passant capture therewith.
By the end of the 15th century, most of the modern rules for the basic moves had been adopted (from Italy): bishops could move arbitrarily far along an open diagonal (previously being limited to a move of exactly two squares diagonally) while losing the ability to jump over the intervening square, and the queen was allowed to move arbitrarily far in any direction, making it the most powerful piece. (Before, she could only move one square diagonally.) There were still variations in rules for castling and the outcome in the case of stalemate.