Gabriel Oak is a 28-year-old sheep farmer of modest means who has just acquired a herd of 200 sheep of his own. Quiet, but well-liked, Gabriel spends most of his time tending his flock. One day he sees a beautiful woman in a wagon filled with boxes. The woman's beauty intrigues him, and Gabriel finds himself watching her, unobserved, over the next few weeks. When the wind takes her hat one afternoon, Gabriel searches for it and returns it to her. She is embarrassed by his bold, uncultured manner.
Several days later, Gabriel forgets to open a window in his sheep hut before he falls asleep. Smoke from the fireplace fills the room. The young woman breaks into the house and wakes him before he succumbs to the smoke. He asks her name, but she flirtatiously tells him to discover it on his own. He learns that she is Bathsheba Everdene and is staying with an aunt in the area.
Gabriel calls on the aunt and asks if he might marry Bathsheba. The aunt tells him that Bathsheba has had many lovers in the past. Gabriel leaves, but Bathsheba chases after him to explain that her aunt is lying. She has not had any lovers. Gabriel assumes she must like him if she's gone to such extremes to tell him of her aunt's deception. He asks if he might court her, and she says that their relationship would never lead to marriage because she doesn't love him.
Bathsheba moves away to town called Weatherbury, leaving Gabriel behind, still pining for her. Tragedy strikes one night when his young sheep dog runs his entire flock off the side of a cliff. Gabriel is heartbroken, not only for the loss of his future as a self-sufficient farmer, but also for the suffering ewes and their unborn lambs. He sells what little he has left to pay his debts and thinks about how grateful he is that Bathsheba didn't marry him, as he wouldn't want her to suffer such poverty.
Gabriel travels to a nearby town that is having a hiring fair. At first he tries to find work as a bailiff — a kind of manager and overseer of a farm. When that fails, he sells his good coat to pay for a shepherd's staff and tries to find work as a shepherd. Desperate, he earns a little money at the fair by playing his flute. He learns that another town, Weatherbury, is having a hiring fair soon. He hides aboard a wagon to get some sleep, waking as it begins to move. He overhears the owners say they are going to Weatherbury. He rides most of the way with them before slipping off the back.
As he walks to the town, he sees that something is on fire in the distance. He hurries to it. The workers of the barn are frantic. Gabriel takes charge and risks his own life to climb to the top of the hay to stamp the fire out with his shepherd's hook while organizing the other workers to quench the fire below.
When the veiled mistress of the barn learns of this stranger's heroics, she asks to meet him. She offers him a reward. He asks if she might be in need of a shepherd. When she lifts her veil, Gabriel is surprised to see it is Bathsheba. She agrees to give him a job as her shepherd, much to the delight of all her workers. She tells him to find her bailiff and tell the man of her order.
On the way to town, Gabriel comes across a young, timid woman who begs him not to tell anyone he's seen her. He fears she must be in some trouble, but the woman will accept no help. He hands her a few pennies for her journey. Gabriel tries to find the bailiff in the local malt house, but to no avail. He does meet several other workers, however, and has a drink with them before leaving. Once he's gone, news comes that Bathsheba discovered her bailiff cheating her and so fired him. She's also asked the locals to be on the lookout for her young servant, Fanny, who has run off.
Fanny makes her way to the barracks where her lover is stationed. She throws snowballs at his window until he opens it to talk to her. He is rather callous to her, but Fanny reminds him of his promise to marry her. He agrees, but tells her he can't meet her now.
Bathsheba makes the bold move to act as bailiff for the estate she's inherited. When she attends market day in her new role, the other farmers are rattled by her beauty, except for Mr. Boldwood, a handsome bachelor whom many have tried to court, but none have succeeded. Bathsheba is piqued by his lack of attention.
The following day she makes out a valentine for a young serving boy. Her maid Liddy suggests she make it out to Boldwood instead. Bathsheba tosses a book to decide who will get the card. When the book lands closed, she addresses it to Mr. Boldwood, but leaves it unsigned, and then, on a whim, presses the message Marry Me onto the seal. Bathsheba and her maid think nothing of their prank, but the missive moves Mr. Boldwood to wonder who could desire him. He is obsessed with discovering the identity of the mysterious suitor.
The next day he comes across the mail cart and accidentally opens a letter because the handwriting is the same as on his valentine. He discovers that it is for Gabriel Oak and was sent by Fanny to repay him for the money he lent her. It also tells him that she will wed Sergeant Troy. Boldwood delivers the letter to Gabriel and learns that the handwriting on the envelope is that of Bathsheba Everdene.
Troy waits in the church for his bride, Fanny, as women twitter and gossip. He waits for an hour, but she never arrives. He finally leaves and encounters Fanny running across the square to meet him. She had gone to the wrong church. She asks when they can reschedule the wedding, but Troy doesn't give her an answer.
The ill-fated valentine causes many problems. Boldwood observes Bathsheba in town, and because of her beauty, falls in love with her. Bathsheba worries that if she approaches him, he will take it as a sign of her interest in him. She decides to ignore him. Gabriel sees the furtive glances between the two and believes there may be a blossoming romance. Boldwood finally gets the courage to speak to Bathsheba and propose to her. She tries to dissuade him, but he insists she wait to give him a definitive answer and allow him to propose again at a later date.
Bathsheba asks Gabriel if he and any of the other workers saw her in conversation with Boldwood. When he admits she was observed by all, she wonders what Gabriel thought of her behavior. He bluntly tells her that it has not been the proper behavior for a woman of her stature. She becomes angry and accuses him of being jealous, but he claims to have long ago given up any idea of marrying her. She fires him on the spot, and he agrees to leave.
The following day, her workers come to beg her to rehire Gabriel. Her sheep have wandered into new clover, and she is in danger of losing them all, as their stomachs will explode if not given an emergency operation. Only Gabriel is capable of performing the procedure. She orders them to bring him back, but he sends a message telling her he will only come if she asks him politely. She begs him not to abandon her, and he returns, saving all but one of the ewes. She asks him to return permanently as shepherd, and he agrees.
At the sheepshearing, Bathsheba's workers discuss the possible marriage of their mistress and Mr. Boldwood. When he arrives at the ensuing dinner, Bathsheba asks Gabriel to move so Boldwood may sit next to her. She tells him she may be ready to consider his proposal. It's fortunate she makes him no promises, however, because on her rounds of the farm, she and a stranger become entangled. Troy's spur gets caught in her dress and the two have a lengthy conversation as they try to separate themselves. She is immediately drawn to his good looks, but pretends to be appalled at his forward behavior.
She and Troy have several other encounters, and Bathsheba is soon beside herself with love. Gabriel, who knows Troy's reckless character because of the letter Fanny sent him, tries to warn her. As he won't give details, Bathsheba assumes he's jealous and merely trying to ruin her relationship with the dashing soldier. She fires him again, but Gabriel refuses to leave unless she hires a bailiff to help her manage the farm. When she gets home, she overhears her servants talking about Troy. She quickly admonishes them but conveys her true feelings to Liddy.
Troy leaves for several weeks for Bath. Bathsheba formally refuses Boldwood's offer of marriage. He confronts her with the knowledge that he knows Troy has stolen her affections and chastises her for being besotted by a uniform. She confesses that she has kissed Troy, and Boldwood, in a fury, threatens harm to the soldier if he ever returns to Weatherbury. Fearful, Bathsheba sneaks to Bath to warn him.
Two weeks later, Boldwood meets Troy while walking late at night. The farmer offers Troy a large sum of money to leave Weatherbury for good and marry Fanny. Troy agrees, but then they hear Bathsheba nearby. Boldwood hides while they talk. She invites Troy back to her house. Infuriated, Boldwood insists Troy take the money to marry Bathsheba to save her good name. He agrees, but insists the farmer come back to the house to sign a contract.
When they arrive, Troy shows him the announcement of his marriage to Bathsheba several days ago. Troy refuses the farmer's money and throws him from the house. Boldwood becomes despondent over Bathsheba's marriage. Although Gabriel is also heartbroken by the news, he diligently works Bathsheba's farm, single-handedly saving it from financial ruin by protecting the grain and corn from a violent storm.
Several months later, Troy learns that Fanny is still alive, but sick. He vows to get money to help her. He tells her to meet him in a nearby town in a few days. Bathsheba, already upset at his gambling away her money, insists on knowing why he needs more. He admits it's for a woman he used to know. Bathsheba flees the house after arguing with Troy. He leaves to search for Fanny.
When Bathsheba returns home, a servant tells her that Fanny is dead. Bathsheba insists the body is brought back for burial as Fanny was her servant. She suspects the girl died in childbirth and confirms her suspicions when she peeks inside the coffin and sees the young mother and her child.
When Troy comes home and discovers Fanny is dead, he cruelly admits to Bathsheba that he never loved her and will always love Fanny. He leaves the farm despairing his loss. He pays for Fanny's headstone, then leaves town. He decides to swim in the ocean to cleanse himself, leaving his clothes and watch on the shore. A riptide threatens to drown him, but he is saved at the last minute by a boat, but doesn't return to Bathsheba.
Everyone in Weatherbury assumes Troy has died. Bathsheba clings to hope that he is alive. After a year, Boldwood approaches her again and begs her to consider his proposal. He's heard that she may be agreeable to another marriage if Troy has not returned in six years, the time it takes to be legally confirmed dead. Afraid of his obvious mental unbalance, she agrees to think again on his offer and will tell him her decision at Christmas.
Meanwhile, Troy has secretly returned to the area. He spies Bathsheba at a fair and is again smitten by her beauty. He wonders what her money situation is and decides to wait to reveal himself until he knows if he'll be held liable for any debts.
Boldwood throws a huge party at Christmas for the entire town. When Bathsheba tries to leave without giving him a firm answer to his suit, he corners her alone. Mad with love for her, she is afraid to turn him away and agrees to marry him in five-and-a-half years. They return to the party but are interrupted by a visitor for Bathsheba. It is Troy. He insists she return with him to their house. In shock, she screams. Boldwood takes a shotgun from the mantel and shoots Troy. Stopped from killing himself, Boldwood turns himself in to the authorities. Several months later, Boldwood is tried and sentenced to hang. The citizens of Weatherbury sign a letter telling the judge of the farmer's obvious mental instability and beg for leniency. On the eve of his execution, he is granted a stay. He will remain in jail.
Bathsheba is heartbroken when Gabriel tenders his resignation. She visits him in his hut and learns he is leaving because the townspeople believe he is secretly hoping to marry her. When she admits that she would no longer be opposed to the marriage, they wed secretly the following day in a small ceremony. That night as they dine, the farmworkers come to congratulate and serenade them.