(CNN) -- A young Sri Lankan woman has been executed with a sword in a small, dusty town in Saudi Arabia, thousands of miles from the lush jungles and idyllic beaches of the country where she grew up.
Rizana Nafeek arrived in Saudi Arabia in 2005.
CNN iReport: Share your views
Authorities executed her Wednesday in Dawadmi, about 200 kilometers west of the Saudi capital, Riyadh.
She spent her first few weeks in Saudi Arabia working as a housemaid to earn money to support her relatives back home, who had been displaced by the massive tsunami in the Indian Ocean the year before.
Saudi women educated, unable to work
Saudi woman beheaded for 'sorcery' Nafeek spent the next seven years in Saudi jails as she was accused, charged, convicted and sentenced to death in the killing of her employers' four-month-old son.
Passport photo of Rizana Nafeek
Passport photo of Rizana Nafeek
Read more: Sri Lanka appeals to Saudi king to spare maid's life
The family said she had strangled the boy, Kayed bin Nayef bin Jazyan al-Otaibi, after being asked to bottle feed him. Nafeek said the infant accidentally choked on milk.
She found herself plunged into the unfamiliar, unfriendly and -- according to many human rights advocates -- unfair Saudi legal system.
In cases where the death penalty is possible, "defendants are rarely allowed formal representation by a lawyer and in many cases are kept in the dark about the progress of legal proceedings against them," Amnesty International says.
Nonetheless, human rights groups and the Sri Lankan government lobbied Saudi authorities to release her, or at the very least show some leniency in her complicated case.
Read more: Saudi woman beheaded for 'witchcraft and sorcery'
They argued that the courts had failed to take into account Nafeek's birth certificate, which showed she was only 17 at the time of the baby's death in 2005, making her too young to receive the death penalty under international law.
The passport she used to enter the country, which said she was 23 at the time, was inaccurate and had been falsified, they said.
Additionally, she had not had access to lawyers during her pre-trial interrogation during which she said she was assaulted and forced to sign a confession under duress, rights groups pointed out.
Right up until the end, they pointed out that the dead boy's family could still grant Nafeek a pardon or request blood money as compensation.
Read more: Saudi support for Syrian rebels shaped by tribal, religious ties
But those arguments and others, as well as numerous visits by Sri Lankan ministers and members of Nafeek's family, failed to sway Saudi authorities.
The interior ministry statement announcing the execution began with a verse from the Quran, according to SPA, the official Saudi News agency: "O ye who believe! the law of equality is prescribed to you in cases of murder."
The death penalty for Nafeek had been approved by the Supreme Court, the agency reported, and a "high order was issued" to carry out the sentence.
The Sri Lankan government and human rights groups have sharply criticized Saudi Arabian authorities for the beheading of Nafeek.
It shows "once more how woefully out of step they are with their international obligations regarding the use of the death penalty," said Philip Luther, director of Amnesty International's Middle East and North Africa program.
President Mahinda Rajapaksa of Sri Lanka, who had made personal appeals for clemency in Nafeek's case, said he and his government deplored the decision to go ahead with the execution. Lawmakers in the Sri Lankan parliament observed a minute of silence Wednesday to mourn her death.
But her case appears to be far from a one off occurrence.
Many of the people executed in Saudi Arabia in recent years have been foreign citizens, according to Amnesty International, most of them "migrant workers from poor and developing countries."
In 2012, Amnesty said it had recorded at least 79 executions in the country, 27 of them of foreigners.
Saudi Arabia also has a history of carrying out the death penalty on people convicted of committing crimes when they were children, according to Human Rights Watch.
"Rizana was just a child herself at the time of the baby's death, and she had no lawyer to defend her and no competent interpreter to translate her account," said Nisha Varia, senior women's rights researcher at Human Rights Watch. "Saudi Arabia should recognize, as the rest of the world long has, that no child offender should ever be put to death."
CNN's Jethro Mullen in Hong Kong reported and wrote. CNN's Salma Abdelaziz and Saad Abedine in Atlanta, and journalist Iqbal Athas in Colombo, Sri Lanka, contributed to this report.