A Spanish court has jailed a woman for five years for going into hiding with her two sons rather than hand them to the father, whom she accused of abuse.

Juana Rivas has also been stripped of custody rights for six years and told to pay hefty legal costs.

Spanish politicians and women's groups have criticised the verdict.

The long-running custody battle for the boys - now aged 12 and four - has become a rallying point in Spain's battle against gender violence.

What did Rivas do?
She took the boys from the family home in Italy in 2016, and travelled to Spain under the pretext of visiting family.

Instead of returning, she lodged a complaint in Spain alleging domestic abuse and later defied Spanish court orders to return the boys to their father.

"A woman running away from terror to protect her children can't be deemed abduction," she said last year.

Her actions became a social media sensation in Spain, where #JuanaEstáEnMiCasa (Juana is in my house) was a major trend as she avoided authorities.

She eventually turned herself in and the children were reunited with their father.

What did the court rule?
The court in the southern city of Granada said Rivas had no proof of domestic violence and had illegally taken her children from their father.

She had "exploited the argument of abuse" and had carried out "child abduction", the judgement said.

Her former partner, Italian Francesco Arcuri has a previous conviction for violence against Ms Rivas.

But despite this the court said there was no evidence of mistreatment since then and an assessment of the oldest child showed no signs of psychological trauma consistent with abuse.

What reaction has there been?
Rivas's lawyer has called the judgement a "failure of the judicial system" and indicated she would appeal against the verdict.

Spain's Deputy Prime Minister Carmen Calvo has said that Rivas will not be jailed until the sentence is confirmed.

"The interests of the two children must be protected, even in these moments," she said.

Antonio Maíllo, head of a left-wing federation of parties in the southern Andalucia region, said the verdict was "barbaric" and set a worrying precedent.

"This country has changed but the judiciary is carrying on with outmoded parameters," he said.

The president of the Progressive Women's Foundation, Yolanda Besteiro, told Spain's Efe news agency that the ruling was disproportionate "because the situation of mistreatment was not taken into account".

She said the ruling "demonstrates the lack of empathy and ignorance of what gender violence is and how abusers behave".

Some groups are preparing demonstrations, in a move reminiscent of the widespread protests over the infamous "wolf pack" sexual assault case in Pamplona.

What does the father say?
Mr Arcuri denies any abuse of either Rivas or the children and says he has been the victim of a media campaign.

He has a previous conviction for violence against Rivas on one occasion in 2009 - but he now says he only admitted to the charge to avoid a lengthy legal battle and retain visiting rights with his son.

The couple reunited after that incident and had a second son.

Mr Arcuri's former partner of 10 years also came to his defence last year, telling Spanish media she did not believe the abuse allegations.