The Kabul primary court also sentenced eight people to 16 years in prison while 18 others were found not guilty after a three-day trial broadcast live on national television.
A furious mob turned on 27-year-old Farkhunda on March 19, beating her in broad daylight and setting her body ablaze on the banks of the Kabul River.
The attack came after an amulet seller, whom she had reportedly castigated for peddling superstition, falsely accused her of burning the Koran.
Her killing triggered protests around Afghanistan and drew global attention to the treatment of Afghan women.
Afghan protesters hold banners as they shout slogans during a rally in front of Kabul supreme court, in Kabul on March 24, 2015, held to protest the killing of Afghan woman Farkhunda. More than a thousand people protested in the Afghan capital, to call for justice after a woman was brutally killed by a mob who falsely accused her of burning a copy of the Koran. The woman, 27 year-old Farkhunda was beaten with sticks and stones, thrown from a roof, before being run over by a car outside a mosque in Kabul on March 19, the mob then set her body a blaze and dumped it in Kabul river while police allegedly looked on. AFP PHOTO
Forty-nine people were arrested, including 19 police officers, some of whom were shown standing by and doing nothing to stop the mob in cellphone videos recorded by bystanders.
The trial, which drew praise for its fast-track nature but also prompted concern over its fairness, saw the suspects facing various charges including assault, murder and inciting others to participate.
Judge Safiullah Mojaddidi, announcing the verdict, said Zainul Abiddin, Mohammad Yaqub, Mohammad Sharif and Abdul Bashir would be hanged.
"It is not a final decision and their right to appeal is reserved," the judge said.
Farkhunda's parents, who were in court on Wednesday, said before the verdict was announced that they "only want justice, nothing else".
Her brother Mujibullah said his family was not happy with the large number of acquittals in a murder caught on cellphone cameras and circulated on social media.
There were dozens and dozens of people "involved in killing of my sister and the court only sentenced four to death", he told AFP.
"We want the court... to bring more perpetrators to justice."
Suspects stand before a judge during a primary court trial in Kabul on May 2, 2015. The first trial of 49 suspects, including 19 police officers, on charges relating to the mob killing of an Afghan woman began in Kabul on May 2 and is expected to continue for two days. The suspects all face charges relating to the March 19 killing of a 27-year-old woman, Farkhunda. AFP
The verdicts on the policemen accused of "negligence of duty" will be announced on Sunday and the court also ordered security forces to arrest three other key suspects.
Farkhunda's case become a symbol of the endemic violence that women face in Afghanistan, despite reforms since the hardline Taliban regime fell in 2001.
The backlash highlighted the angst of a post-Taliban generation in Afghanistan -- where nearly two-thirds of the population is under 25 -- that is often torn between conservatism and modernity as the country rebuilds after decades of war.
Last October five Afghan men were hanged over a gang rape that sparked a national outcry, even though the United Nations and human rights groups called for President Ashraf Ghani to stay the executions.
A recent UN report entitled "Justice through the eyes of Afghan women" urged the government to strengthen access to justice for women victims of violence.
Most cases of violence against women are settled through mediation, highlighting perceived deficiencies in the Afghan criminal justice system including allegations of corruption and abuse of power, the report said.