The episode was written by Ira Steven Behr and Hans Beimler and directed by Allan Kroeker. An early draft of the script has Sisko dying during the final battle at Cardassia, but resurrected by the Prophets to fight the Pah-wraiths. Sisko's joining with the Prophets following Dukat's defeat was originally going to be permanent but actor Avery Brooks was "uncomfortable with the notion of a black man abandoning his pregnant black wife"; the line was rewritten upon Brooks's request to indicate that he would return. Keith DeCandido praised this move in his review. The producers also entertained the idea of a final shot of Benny Russell (from "Far Beyond the Stars" and "Shadows and Symbols") sitting outside a studio holding a script for "Deep Space Nine".