Time: Unspecified
Place: In the thrice-tenth kingdom, a far off place (beyond thrice-nine lands) in Russian fairy tales
Note: There is an actual city of Shemakha (also spelled "Schemacha" and "Shamakhy"), which is the capital of the Shamakhi Rayon of Azerbaijan. In Pushkin's day it was an important city and capital of what was to become the Baku Governorate. But the realm of that name, ruled by its queen, bears little resemblance to today's Shemakha and region; Pushkin likely seized the name for convenience, to conjure an exotic monarchy.
However, his sons are both so inept that they manage to kill each other on the battlefield. King Dodon then decides to lead the army himself, but further bloodshed is averted because the Golden Cockerel ensures that the old king becomes besotted when he actually sees the beautiful Queen. The Queen herself encourages this situation by performing a seductive dance - which tempts the King to try and partner her, but he is clumsy and makes a complete mess of it. The Queen realises that she can take over Dodon's country without further fighting - she engineers a marriage proposal from Dodon, which she coyly accepts.
The Final Scene starts with the wedding procession in all its splendour. As this reaches its conclusion, the Astrologer appears and says to Dodon, "You promised me anything I could ask for if there could be a happy resolution of your troubles ... ." "Yes, yes," replies the king, "Just name it and you shall have it." "Right," says the Astrologer, "I want the Queen of Shemakha!" At this, the King flares up in fury, and strikes down the Astrologer with a blow from his mace. The Golden Cockerel, loyal to his Astrologer master, then swoops across and pecks through the King's jugular. The sky darkens. When light returns, queen and cockerel are gone.
The Astrologer comes again before the curtain and announces the end of his story, reminding the public that what they just saw was "merely illusion," that only he and the queen were mortals and real.