The narrator of the story is a captain whose name we never learn. He is still young, but the story he is reflecting about is of his first command. The story starts from him being on the deck of his anchored ship and looking over the sunset. The sun slowly goes down to Meinam river. Tomorrow they have to leave the Gulf of Siam and head back to England. The young captain feels lonely and uncertain: he knows that the crew doesn’t trust him yet, he is too young and they don’t know him. The nature reflects the captain’s feelings: “nothing moved, nothing lived, not a canoe on the water, not a bird in the air.” But he has not much time for himself, soon the crew starts to noisily prepare for departure. The only man younger than captain on the ship is second mate. The captain has no authority and he had only two weeks to learn about the personalities of the crew members - while they have been together more than a year. They consider him a stranger on the ship and the captain has no option to agree with them. Still, like lots of young and aspiring people he tries to maintain a picture as good as possible, despite his inner doubts of living up to “that ideal conception of one’s own personality every man sets up for himself.”
While going to have dinner with the rest of the officers, the captain notices that another ship has entered the Gulf and is now behind the small island not too far away from them. He tells the officers about that ship and the second mate supposes that it is an another English ship also waiting for the departure home. He also adds that he heard from the skipper of the tugboat that an English ship from Liverpool named Sephora should be here and leave back to Cardiff carrying coal. So that is the reason he suggests the ship behind the island is Sephora. After the dinner the captain decides to win the respect of the crew and he orders that all of them can have a rest while he himself will take the first watch. At one o’clock, after five hours, the second mate will change him and take the second watch. The first mate and the rest of the officers are impressed by the order, but gladly agree to have a rest, while two young people will guard the ship.
The captain is glad to be left alone on the deck again. Content with himself and his idea to raised his authority among the rest of the crew, he smokes the cigar. The feeling of loneliness didn’t vanish, but he decides that it is the part of the captain’s duty - not to have friends amongst the crew - so he has to get used to it and stop feeling so uneasy about it. During his watch he looks at his ship and admires it, thinking about it being very fine. The captain also plans the crucial point of his future journey back to England. This thoughts reinforce his confidence and, after the captain goes downstairs for another cigar and smokes it, he feels much more positive, praising himself for such a good career choice. He thinks about his life on the ship and remembers his past on the land and his feelings are summed up as “the great security of the sea as compared with unrest on the land”. But gradually, the captain starts to worry about his decisions again: he overturned the average routine of the crew, taking watch out of the turn. Now the captain concerns about the effect in may have on the crowd: do they really respect him more now or just think of him as of idealistic young fool?
Immersed in his thoughts, the captain suddenly notices the rope ladder still hanging from the board of the ship. Thinking about the crew forgetting to take it away after the skipper of the tugboat left the ship, the captain comes and starts to bring in the ladder himself. Surprisingly, the ladder appears too heavy for the one man to pull it up. Amazed, the captain decides to look down over the rail and sees a strange item floating near the ladder. At first it looks like a headless corpse tangled in the ropes, but then the “corpse” moves and appears to be a living, naked man. The captain is so shocked that he accidentally drops his cigar into the water and blatantly asks the man what the matter. The man curses and says that his name is Leggatt. After a short talk where the captain reassures him that he is in command on the ship and won’t mean Leggatt any harm, the man starts to slowly climb the ladder. He is frozen to the bones and the captain leaves him for a while to get him some clothes. He decides to keep the arrival of the “guest” secret for now, so he checks if the crew is asleep already before taking the spare sleeping suit, similar to the one he has. Leggatt dresses up and they both now look similar, barefoot, in identical clothes. The captain feels strange, now Leggatt looks “like his double”.
Leggatt indeed looks very similar to the captain. He is tall, well-built, looks around twenty five years old and has a prominent brown mustache. When he warms up, he tells the captain his story: he was a mate of the Sephora (the first mate from the captain’s ship was right: it is Sephora behind the island). While listening to his story, the captain can’t stop comparing himself to Leggatt, finding the resemblance almost uncanny: “It was as though I had been faced by my own reflection in the depth of a somber and immense mirror.” Meanwhile Leggatt continues. He tells that Sephora was caught in a dire storm. The crew was exhausted both physically and emotionally, fighting the constant danger and just trying to keep the ship afloat and the crewmembers alive. Everyone was on the edge. While, during one sleepless night, one of the crewmen got into an argument with Leggatt, being overly rude and disrespecting, Leggatt, unable to keep his anger at bay, started to choke him. But at that very moment, an impending gale hit the boat and the man died in Leggatt’s arms. Leggatt had no intention to kill the fellow sailor, but the rest of the crew and captain of Sephora himself saw the thing differently, deciding that they have just became witnesses of the intended murder. Leggatt was accused of killing the man and locked in his cabin until Sephora’s return to England where he would be put into trial for murder. Desperate and knowing that he would most probably be executed, Leggatt decided to escape.
The captain listens to Leggatt’s story attentively and says that he believes him. Leggatt described the situation very precisely and, imagining it, the captain decides that Leggatt’s version looks very plausible and it definitely was a tragic accident, not an intended murder. The captain decides to hide Leggatt in his own stateroom for a while and then come up with a plan of further actions. Meanwhile, his watch is coming to an end, so, after hiding Leggatt in the stateroom, the captain goes to wake up the second mate and order him to take the next watch. The captain returns to the stateroom, thinking that “everything was as before in the ship—except that two of her captain’s sleeping suits were simultaneously in use.”
The shape of the stateroom, similar to the letter L, allows the captain to easily hide Leggatt around the corner. When the captain enters the stateroom, they stand from the different sides of the bed, again resembling the mirrored images of each other. Leggatt continues his story of escaping Sephora. Three weeks before, he had a talk with the captain of the ship. Leggatt reminded the captain that he saved the ship during the storm and all the crew is now indebted to him. He asks the captain to “accidentally” leave the door open, so that Leggatt can escape. The captain, who Leggatt calls Skipper, admits that Leggatt indeed saved them all but still refuses to help him. Leggatt has to wait for a long time until now. When the steward accidentally (this time for real) leaves the door of his cabin opened, Leggatt used the chance and jumped to the water. He managed to swam to the rocks amidst the gulf, where he took off his clothes and sank everything that was on him with the rock. He didn’t have a plan what to do, just hoping to wait until Sephora leaves, but then he noticed the lights on the mast of captain’s ship. Deciding that it’s his chance, Leggatt swims to the unknown ship, but when he reaches it, exhausted - it was more than a mile between his rocks and the ship - he didn’t have enough strength to climb up the ladder, so conveniently forgotten there.
They finish their conversation very quietly, because both men hear the steps of the second mate above. At 3 AM the captain, who finally hears everything he wanted from his guest, offers him his bed, while taking a nap at the coach by himself. In the morning he wakes up because the steward is already knocking at the door of the stateroom, bringing the captain his coffee. The captain is close to panic, understanding that his secret can be revealed right here and now. But luckily, the steward isn’t too curious, he just gives the coffee and leaves. Going to the deck, the captain bolts the door to his stateroom, just in case. Despite the sleepless night, he acts like an iconic captain and the crew seem to give him at least some respect. But during the dinner with the rest of the officers, the captain becomes nervous again. The matter is that the dining room and his stateroom share the bathroom that can be entered from each side. The captain can’t stop thinking about Leggatt hiding in his room like his distorted reflection, “sleeping in that bed behind the door which faced me as I sat at the head of the table. It was much like being mad, only it was worse because one was aware of it.”
Finally returning back to his stateroom, the captain asks Leggatt to hide in the bathroom and calls the steward to clean the room - doing it to show that there is no one, definitely no strangers in his stateroom and he isn’t hiding anyone. The situation is simultaneously dangerous, grim and amusing to him. He thinks of Leggatt as of “secret sharer” of his life. The captain goes to the bathroom with Leggatt still there and then invites the first mate to the conversation to solidify the idea that there is no one in the room. After the first mate leaves, the captain hides Leggatt in his room again and orders the steward to clean the bathroom (which he does, entering from the saloon side). In the evening one of the crewmembers reports that a boat from Sephora approaches the ship and the captain goes on the deck to greet the visitors.
The visitor is Captain Archbold himself, the skipper of Sephora. Surely, he is searching for his first mate who committed a crime and then escaped. Our narrator has a hard time speaking to him - he isn’t used to lies, so he has to rely on precisely picked exact words. As the captain reflects: "I could not, I think have met him by a direct lie" - and [...] for psychological (not moral) reasons." But finally the captain manages to convince Archbold that there is no one except his own crew at the ship. Captain Archbold asks to warn him if they learn something about the fugitive first mate. He admits that Leggatt’s experience and cold-blooded orders saved the ship during the storm, but nevertheless, Archbold considers him guilty of murder and is sure that no heroic deeds should save him from trial. After a long talk, our captain manages to show the still suspicious Archbold the ship, using the same trick with the two doors to the bathroom to hide Leggatt from him. Archbold has to leave.
After the visit is over, Leggatt, understanding that the secret can’t be kept forever, asks the captain to help him escape. The captain comes up with a risky plan. When the ship leaves the Gulf of Siam and sails over the island near Cambodia, the captain and Leggatt decide that the moment is appropriate. The captain orders to bring the ship closer to the island, almost to the dangerous zone, too close to the shore. When Leggatt is sure that he will be able to swim to the land, he and the captain shake hands and, before Leggatt jumps overboard again, the captain places his hat on the head of his “secret sharer”.
The crew, unaware of the captain’s intentions, watches in shock and awe how the ship passes one island after another. The towering rock of Koh-ring is too near to them. The captain now is equally shocked. He doesn’t know the ship well after only some weeks of commanding, he can’t be sure that she will make it safe. But suddenly he notices something white in the water: his own hat floating on the place where Leggatt started his journey to the safety. This mark helps him to find the right direction and reassures the captain that he is doing everything right, steering the ship out of danger. This dangerous maneuver makes him and all the crew work on the edge of their competence and physical possibilities and when they are finally safe the captain has a moment of epiphany, of "the perfect communion of a seaman with his first command." Walking to the taffrail, the captain looks at the hat, still floating at the waves and thinks about Leggatt, his only friend on that ship, his reflection, a murderer and “a free man, a proud swimmer striking out for a new destiny."