LONDON — A court in France has ruled that a man who died from a heart attack after having sex during a business trip had suffered a work-related accident and that his employer was liable.

The man, who was identified in court documents only as Xavier, traveled in 2013 to the Loiret region in central France as a security technician for the rail engineering company TSO. After work one night, he had sex with a woman at her house before returning to his hotel. He later died from a heart attack said to have been linked to the encounter.

A health insurance fund decided that the death resulted from a work-related accident, but TSO appealed, saying that the employee had interrupted his work trip for an adulterous relationship and had therefore acted outside the company’s purview.

The Court of Appeal in Paris upheld the insurance fund’s decision in a ruling released in May, but the case gained public attention only after the details were published last week on LinkedIn by a French lawyer, Sarah Balluet, who specializes in labor disputes.