This article relies largely or entirely on a single source. (March 2010)
Ibsen had great trouble with the writing of this play. The ending is the most criticized feature, since Bernick is clearly guilty of attempted murder but gets off unscathed, but successfully illustrates that the rich and powerful are often selfish and corrupt.
Ibsen first planned a contemporary drama at the end of 1869 but did not begin writing until October 1875 (in Munich), completing it in the summer of 1877. It was first published on 11 October of that year in Copenhagen, with the first stagings following on 14 November at the Odense Teater and on 18 November at the Royal Danish Theatre in Copenhagen. The first performance in Norway was at Den Nationale Scene in Bergen on 30 November. By this date, the play had been translated into German, in which it was immediately well received. In December 1880 in London it became the first of any of Ibsen's plays to be performed in English (under the title Quicksands).
Karsten Bernick is the dominant businessman in a small coastal town in Norway, with interests in shipping and shipbuilding in a long-established family firm. Now he is planning his most ambitious project yet, backing a railway which will connect the town to the main line and open a fertile valley which he has been secretly buying up.
Suddenly his past explodes on him. Johan Tønnesen, his wife's younger brother, comes back from America to the town he ran away from 15 years ago. At the time it was thought he had run off with money from the Bernick family business and with the urge to avoid scandal because he was having an affair with an actress. But none of this was true. He left town to take the blame for Bernick, who was the one who had actually been having the affair and was nearly caught with the actress. There was no money to take since at the time the Bernick firm had been almost bankrupt.
With Tønnesen comes his half-sister Lona (whom Ibsen is said to have modelled after Norwegian feminist Aasta Hansteen), who once loved and was loved by Bernick. He rejected her and married his current wife for money so that he could rebuild the family business. In the years since Tønnesen left, the town has built ever greater rumours of his wickedness, helped by Bernick's studious refusal to give any indication of the truth.
This mixture only needs a spark to explode and it gets one when Tønnesen falls in love with Dina Dorf, a young girl who is the daughter of the actress involved in the scandal of 15 years ago and who now lives as a charity case in the Bernick household. He demands that Bernick tell the girl the truth. Bernick refuses. Tønnesen says he will go back to the US to clear up his affairs and then come back to town to marry Dina. Bernick sees his chance to get out of his mess. His yard is repairing an American ship, the Indian Girl, which is dangerously unseaworthy. He orders his yard foreman to finish the work by the next day, even if it means sending the ship and its crew to certain death because he wants Tønnesen to die on board. That way he will be free of any danger in the future. Things do not work out like that. Tønnesen runs off with Dina on board another ship which is safe, leaving word that he will be back. And Bernick's young son stows away on the Indian Girl, seemingly heading for certain death.
Bernick discovers that his plot has gone disastrously wrong on the night the people of the town have lined up to honour him for his contribution to the city.
It is all set up for a tragic conclusion, but suddenly Ibsen pulls back from the brink. The yard foreman gets an attack of conscience and rows out to stop the Indian Girl from heading to sea and death; Bernick's son is brought back safely by his mother; and Bernick addresses the community, tells them most of the truth and gets away with it. His wife greets the news that he only married her for money as a sign there is now hope for their marriage.