Recovered from an injury, Jim seeks a position on the Patna, a steamer serving the transport of 800 "pilgrims of an exacting belief" to a port on the Red Sea. He is hired as first mate. After some days of smooth sailing, the ship hits something in the night and begins taking on water. The captain thinks the ship will sink, and Jim agrees, but wants to put the passengers on the few boats before that can happen. The captain and two other crewmen think only to save themselves, and prepare to lower a boat. The helmsmen remain, as no order has been given to do otherwise. In a crucial moment, Jim jumps into the boat with the captain. A few days later, they are picked up by an outbound steamer. When they reach port, they learn that the Patna and its passengers were brought in safely by a crew from a French navy ship. The captain's actions in abandoning both ship and passengers are against the code of seamen and the crew is publicly vilified. When the other men leave town before the magistrate's court can be convened, Jim is the only crew member left to testify. All lose their certificates to sail. Brierly, a captain of perfect reputation who is on the panel of the court, commits suicide days after the trial.
Captain Charles Marlow attends the trial and meets Jim, whose behavior he condemns, but the young man intrigues him. Wracked with guilt, Jim confesses his shame to Marlow, who finds him a place to live in the home of a friend. Jim is accepted there but leaves abruptly when an engineer who had also abandoned the ship appears to work at the house. Jim then finds work as a ship chandler's clerk in ports of the East Indies, always succeeding in the job then leaving abruptly when the Patna is mentioned. In Bangkok, he gets in a fistfight. Marlow realises that Jim needs a new situation, something that will take him far away from modern ports and keep him occupied so that he can finally forget his guilt. Marlow consults his friend Stein, who sees that Jim is a romantic and considers his situation. Stein offers Jim to be his trade representative or factor in Patusan, a village on a remote island shut off from most commerce, which Jim finds to be exactly what he needs.
After his initial challenge of entering the settlement of native Malay and Bugis people, Jim manages to earn their respect by relieving them of the depredations of the bandit Sherif Ali and protecting them from the corrupt local Malay chief, Rajah Tunku Allang. He builds a solid link with Doramin, the Bugis friend of Stein, and his son Dain Waris. For his leadership, the people call him "tuan Jim", or Lord Jim. Jim also wins the love of Jewel, a young woman of mixed race, and is "satisfied... nearly". Marlow visits Patusan once, two years after Jim arrived there, and sees his success. Jewel does not believe that Jim will stay, as her father left her mother, and she is not reassured that Marlow or any other will not arrive to take him from her. Her mother had been married before her death to Cornelius, previously given the role of factor by Stein for her benefit. Cornelius is a lazy, jealous, and brutal man who treats his stepdaughter cruelly and steals the supplies Stein sends for sale; he is displaced by Jim's arrival and resents him for it.
"Gentleman" Brown, a marauder captain notorious for his evil ways, then arrives in Patusan, his small crew on the brink of starvation. The local defence led by Dain Waris manages to prevent the marauders from looting the village and holds them entrenched in place while Jim is away in the island's interior. When Jim returns, Brown deceptively wins Jim's mercy, who hesitantly negotiates to allow them to leave Patusan unobstructed, but reminds Brown that the long passage down river to the sea will be guarded by armed men. Cornelius sees his chance to get rid of Jim. He tells Brown of a side channel that will bypass most of the defenses, which Brown uses, stopping briefly to ambush the defenders he finds. Dain Waris is killed among others, and Brown sails on, leaving Cornelius behind; Jim's man Tamb' Itam kills Cornelius for his betrayal. Jim is mortified when he receives word of the death of his good friend, and resolves to leave Patusan. Jewel, who had wanted Jim to attack Brown and his ship, is distraught. Jim then goes directly to Doramin and takes responsibility for the death of his only son. Doramin uses his flintlock pistols, given him by Stein, to shoot Jim in the chest.
On his regular route, Marlow arrives at Stein's house a few days after this event, finding Jewel and Tamb' Itam there, and tries to make sense of what happened. Jewel stays in Stein's house.