Part I

The novel concerns the love triangle between Kate Cregeen and the two good friends and cousins, the illegitimate, poorly educated but good-hearted Peter Quilliam, and the well-educated and cultured Philip Christian. Kate's father rejects Pete's request to marry his daughter, due to his low prospects, and so Pete sets off to Kimberly, South Africa, to earn his fortune. He leaves Philip in charge of looking after Kate in his absence.
Part II

As Kate matures into an adult woman and Philip rises to become the foremost young lawyer in the island, they begin to fall in love. This is first openly spoken of between them when they hear rumours that Pete has died in Africa. However, the course of their love is still not open as Philip has to choose between worldly success and the position as Deemster, or his love of the lower class Kate. Feeling this push them apart, Kate "is driven to an effort to hold on to the man whom life is tearing away from her by making a mistaken appeal to his love. 
Part III

Pete returns to the island with a fortune fit to have his marriage proposal accepted by Kate's parents, while Kate is bed-ridden recovering from an illness brought about by Philip's breaking with her to stay true to his promise to Pete. Remaining unaware of anything between Philip and Kate, Pete arranges for the wedding, which Kate goes through with in a confused daze.
Part IV

Kate gives birth to a daughter which she realises is Philip s. This fact, along with the reason for Kate's displeasure at the marriage, remains hidden to Pete, who proves himself to be a good and doting husband. When Kate informs Philip of the paternity of the baby girl, they arrange for her to live with him in secret. She leaves Pete's house to go to Philip on the evening when Pete is at the head of the crowd honouring Philip on his return to Ramsey, having been made Deemster.
Part V

Heart-broken at the disappearance of Kate, Pete looks to keep her memory in honour by pretending that she has gone to Liverpool to stay with a fictional uncle. To maintain this lie against the gossip of the town, Pete multiplies his lies in beginning to fake a written correspondence between Kate and himself. As Philip watches his friend's pathetic pretence, he feels the weight of his deceit, which causes him to take to drink and to pull away from Kate who has been secretly installed in his house. This situation continues until Kate leaves Philip so that he is relieved of his wretched situation.
Part VI

With Pete's fortune used up, his deception with the letters is found out and Kate is universally thought of as a fallen woman by everyone but Pete. Meanwhile, the child falls sick, the news of which reaches Kate where she had fled, in London. She returns to see the child where she again meets Pete before throwing herself into the harbour, attempting to end her shameful life. However, she is saved and immediately brought before the Deemster, Philip, to be tried. Philip realises who she is as he commits her to the prison in Castletown, and then faints. Whilst still in a swoon he is taken to Pete's house, where Pete hears Philip's feverish and unconscious confessions. However, instead of wreaking vengeance on Philip and Kate, Pete "realises that he alone is the person in the way, and therefore wipes himself out in order that the woman he loves may be happy.  So Pete determines to leave the island again, divorcing Kate before he goes and leaving Philip with the child and his best wishes. Philip then overcomes his final temptation, to take up the position of Governor, and confesses everything publicly and so unburdes himself. The final scene sees him retrieving Kate from prison to start life afresh.
Output: Who gets Kate out of Prison?