The novel tells the story of Robert Merivel, a 17th-century English physician. After supervising the recovery of one of the dogs of King Charles II, he is appointed surgeon to all of the king's dogs. He then joins in all of the debauchery of King Charles' court. The king then arranges a marriage of convenience between Merivel and one of his mistresses, Celia Clemence. This is done purely to fool the king's other mistress Barbara Castlemaine. Merivel is given an estate named Bidnold in Norfolk, and Celia is installed in a house in Kew, where the king can visit her secretly.
In Norfolk, Merivel abandons the practice of medicine, and lives a dissipated life in which he tries to take up painting with the help of an ambitious painter named Elias Finn. Things start to change when Celia is sent to Bidnold by the king after displeasing him. One night he drunkenly makes advances to her, and is promptly reported to the king by Elias Finn. The result is that the king confiscates the Bidnold estate from Merivel.
Merivel then joins his old student friend John Pearce at the New Bedlam hospital, also in Norfolk. (New Bedlam is fictitious and should not be confused with the real Bedlam in London.) This is a hospital for the mentally ill, run by Quakers, of whom Pearce is a member. In earlier parts of the novel, Pearce has condemned the sinfulness of Merivel's lifestyle, and Merivel now joins the hospital with the best of intentions, and hoping to rediscover his medical vocation. However, things go wrong when he has an affair with a patient named Katharine and makes her pregnant. This coincides with the death of Pearce. He is expelled from the hospital, and travels with Katharine to be with her mother in London.
In London, which is then experiencing the Great Plague, Merivel continues practising medicine. Katharine has a baby girl, but dies in childbirth. During the Great Fire of London in 1666, he rescues an elderly woman from a burning house. It is this which regains him the king's favour, and at the end the king allows him to live at Bidnold with his daughter.
The title of the novel refers both to the Restoration period during which it occurs, and to the novel's ending when Merivel returns to Bidnold and the king's favour.