BANGKOK — Six men were sentenced to death by a court in southern Thailand for the massacre of eight members of one family, including three children, over a land and loan dispute.

The Krabi provincial court on Wednesday found them guilty of conspiracy to murder and related charges for the killings last July. Several defendants pleaded guilty to some charges, which would normally result in a reduction of their sentence, but the court said it did not commute the sentences because the crime was “deeply upsetting and causing public fear.”

Although Thai courts dispense death sentences for various crimes, executions are rare, the last one being about 10 years ago.

Two other defendants were convicted of lesser charges.

On the evening of July 10, the gunmen dressed in clothes resembling official uniforms entered the home of Worayuth Sanglhung, a village headman in Krabi province.

They held the 11 residents captive before shooting them in the head and escaping. The victims included girls aged between 4 and 14, while three people survived, one woman because she fainted and was taken for dead after a bullet grazed her. Police said she provided key details for solving the crime.

One of those sentenced to death was Surikfad Bannopwongsakul, a local businessman who had a bitter feud with Worayuth.

Police said the feud began after Worayuth lodged a land title with Surikfad as security for a loan, but Surikfad then failed to redeem the deed after the loan was paid off.

Land disputes in Thailand sometimes take a violent turn, and several high-profile murders related to land rights have occurred in recent years. In 2014 and 2015 in Krabi, at least two fatal shootings were suspected to be disputes over land used for oil palm plantations. Land values in parts of Krabi also have climbed in recent years because the coastal province is popular with tourists.

Those killings typically target the individual directly involved, often done by hit-and-run gunmen.