Image copyright Getty Images Image caption Andal Ampatuan is part of the powerful Ampatuan family clan

A Philippines court has found the masterminds of the country's worst political massacre guilty of murder.

In 2009, 58 people - 32 of them journalists - were killed when their convoy was attacked in the southern province of Maguindanao.

Five members of the clan, including brothers Andal Ampatuan Jr and Zaldy Ampatuan, were sentenced to life in prison. A third brother was acquitted.

The case was seen as a test of the integrity of the justice system.

It comes amid claims by rights groups that impunity for powerful politicians is on the rise in the country, says the BBC's Howard Johnson in Manila.

Three other members of the clan - Anwar Ampatuan Sr, Anwar Ampatuan Jr, and Anwar Sajid Ampatuan were also found guilty.

The Ampatuans deny all charges and said they would appeal against the verdict.

Other suspects, who were ordered by the Ampatuan family to carry out the killings, received sentences of between six to 10 years in prison.

About 80 other suspects remain at large, including police officers and Ampatuan clan members.

Many accused police officers were acquitted.

Image copyright Getty Images Image caption A vigil took place this month in Manila to remember victims of the massacre

What happened in Maguindanao?

The restive province of Maguindanao had for years been governed by the Ampatuan family, who occupied almost all the political posts in the area.

But in the elections for provincial governor, a rival from another influential clan emerged - Esmael Mangudadatu.

On Nov 23 in 2009, a convoy of vehicles carrying the wife, sisters and other female relatives of Mr Mangudadatu set out to register their candidate for the poll.

A group of 32 journalists and media workers were also there to capture the event - a total of 58 people were present.

Their convoy was kidnapped by henchmen allegedly sent by members of the Ampatuan clan, who ordered them brought to a hilltop and shot.

Their bodies were found in a mass grave.

"My wife was shot 17 times. They shot her breasts, her private part. I cannot just forget that," said Mr Mangudadatu, who went on to be elected the governor of Maguindanao.

Media playback is unsupported on your device Media caption Esmael Mangudadatu is the governor of Maguindanao province, one of the most troubled parts of the region

Rights group Amnesty International called Thursday's verdict a "critical step towards justice".

However, it said the "search for justice is far from over" and called for the government to "dismantle private armies that underpin the power of political clans".

'Say yes or get killed'

Today's guilty verdicts were a hammer-blow to what rights groups say is a culture of rising impunity that has enabled some Philippine politicians to literally get away with murder.

A Human Rights Watch study of the Ampatuan clan in 2010, said they were considered "warlords" in the Maguindanao province.

The word of the clan was the law. "Either you said 'yes' to [them], or you got yourself killed," alleged a then-Ampatuan militia member.

While covering elections here, I've been warned to watch out for "hotspots" - local parlance for an area where the political rivalry is so fierce, threats can turn to violent acts.

President Duterte's spokesperson, Salvador Panelo, welcomed today's verdict - saying it was in keeping with the government's efforts to protect the media from "violence, threat and intimidation".

But Mr Duterte hasn't had always had such a rosy relationship with the press.

"Just because you're a journalist," he said in 2016, "you are not exempted from assassination if you're a son of a bitch."

Who were the victims?

Image copyright Getty Images Image caption A banner from a victims' commemoration in 2015

The victims were mainly female relatives of Mr Mangudadatu and journalists who had been covering the story.

No male relatives of Mr Mangudadatu went with them, as they feared they would come under attack. Mr Mangudadatu said he did not think women would be attacked.

The Committee to Protect Journalists (CPJ) described the killing as the single deadliest event for journalists in history. And today, journalists in the Philippines are not entirely safe.

According to the CPJ, it still remains the 10th most dangerous country to be a journalist, with some facing "online abuse and personal attacks" for their critical reporting of the government.

Why has the case taken so long to resolve?

It's been 10 years since the massacre happened and Thursday's trial saw verdicts on more than 100 suspects including members of the Ampatuan clan.

Around 80 suspects are still at large. At least four witnesses have been killed before they could testify, according to media reports.

"Observers have argued [that] the power of the Ampatuan family and its extensive network of allies and contacts in itself constitutes a threat to the proceedings," the International Press Institute (IPI) said.

According to the IPI, a court interpreter quit after he was allegedly threatened by the Ampatuans.

Several family members of the deceased have also reportedly said that the defence offered them money to withdraw from the case.