The men pleaded not guilty and will appeal the court's decision
Two Swedish men were sentenced to life in prison on Monday for "terrorist crimes" in Syria in 2013, a Swedish district court said in a statement.
The two men, aged 32 and 30, were convicted of assisting in executions in Syria.
During a search of one of the men's homes, police had found a USB stick containing films showing the killings, the court was told.
In a video shown in court by the prosecutor, masked men stood around three men on their knees with their hands tied behind their backs.
Two of the victims have their throats slit. The head of one is cut off and held up for display. Their captors - including the men identified by the prosecutor as the two Swedes - are seen cheering.
The court argued that since the killings and the video intended to seriously intimidate the population of Syria, the two men's actions should be considered a terrorist crime.
"They didn't hold the knife, but otherwise they were highly involved," prosecutor Agnetha Hildning Qvarnstrom said during the trial.
The court did not name the organisation the men fought for but said it was proven that the men sympathized with a regime based on sharia law and the creation of a caliphate.
The two men pleaded not guilty, claiming they had not been among the masked men. Swedish news agency TT said both would appeal the court's decision, and for legal reasons most Swedish media did not reveal their identities.
The identities of the executed men were not clear but the court said they were likely to have been civilians.
It was the first conviction of Swedish citizens on charges of "terrorist crimes" in Syria. Mouhannad Droubi, 28, a Swedish resident, was however sentenced to five years in prison in February for a "torture-like" assault in Syria that was filmed and posted on social media.
According to security police, around 280 Swedes have joined terrorist organisations in Syria or Iraq since 2012 and around 115 have returned to Sweden.