A disgruntled customer set fire to a sex shop "in frustration", a court has heard.
Neil Andersen, 42, walked into the store with a fuel container and told the startled shop worker "I've got a surprise for you" before throwing petrol at him, it has been claimed.
The worker fled fearing for his life and Andersen threw the accelerant around the sex shop before lighting a match and fleeing, Bristol Crown Court was told.
Andersen carried out the attack because he was "frustrated" with the owners of the private shop on the Lower Bristol Road, in Bath, Somerset.
Prosecutor Richard Posner told jurors that Andersen was not acting impulsively and he had carefully planned the arson attack.
On the night of October 21 last year the defendant had bought a green fuel container, purchased petrol from a nearby filling station and then walked to the sex shop and carried out his attack.
The flames destroyed the shop, which is owned by Darker Enterprises Ltd, and also risked the lives of a family living in a flat above.
Mr Posner told the court: "At about 7pm on the evening of October 21 last year Neil Andersen set fire to a shop in Bath that sells sex toys and pornographic material.
"He planned to do it. He was frustrated with the company that owns the shop and the person working inside, Mark Morris.
"His life, the prosecution say, was endangered by what Mr Andersen did. He endangered Mark Morris's life and for the Chinese family that lived above the shop."
The jury of five men and seven women were shown a series of CCTV recordings from a Homebase store, a Sainsburys petrol station forecourt and the sex shop.
Balding and bespectacled Andersen sat impassively in the dock as he watched the video showing him buying a green plastic petrol container from a Homebase store.
He then crosses the road to a nearby petrol station, filling up and paying for the fuel before entering the sex shop.
Mr Posner told the jury: "He has bought the container because this defendant had planned to set fire to the shop.
"He had already decided back home in Bath he was going to do that and so he crossed the road to the Sainsburys petrol station.
"He pays quite calmly for the petrol.
"This is not someone who presents themselves as someone acting impulsively."
Mr Posner then showed the jury the footage from inside the sex shop.
"You will see a bit of a liberal allocation of petrol on the carpet. Then watch what happens.
"Please bear in mind that Mr Morris is in the store and there is a family above the shop.
"Before Mr Andersen leaves he sets fire to the shop. You don't see much more because the place is on fire
"When Mr Andersen went into the shop Mr Morris remembers him saying 'I've got a surprise for you' and throwing some petrol at him.
"The prosecution say that through that action he intended to endanger life."
Mr Posner told the jury that Andersen did not accept that he was acting recklessly or risked endangering the lives of others.
"He says he did not appreciate that anyone was going to be upstairs. That was not something that was forming part of his thought process," the prosecutor said.
"He says that his frustrations were focused at the company."
Andersen, of Wedmore Park, Bath, Somerset, denies charges of arson with intent to endanger life and arson being reckless as to whether life was endangered.
The trial continues.