Bayern Munich and France defender Lucas Hernandez will not have to go to prison in Spain this week after judges instead imposed a suspended sentence.
The regional court in Madrid announced the decision on Wednesday.
A six-month prison term was imposed in 2019 after he breached a six-month restraining order by reconciling with his now wife.
But after hearing his appeal, judges instead suspended the sentence for four years, meaning he avoids jail if he does not commit a crime in that time. He must also pay a fine of 96,000 euros (111,000 dollars).
The restraining order and community service were imposed after a violent altercation took place between Hernandez and his then girlfriend in 2017 while he was playing for Atletico Madrid.
The 25-year-old had been told he had to report to jail in Spain on Thursday if his appeal was not heard before then.
Court officials had said it was doubtful an appeal would be granted in time but the 2018 World Cup winner has won his freedom and is now available for Bayern.
The new ruling came as a surprise to many Spanish legal experts because Hernandez is not a first-time offender.
According to court data, there are two Spanish convictions against him for domestic violence, the one from 2017 which prompted the restraining order but also another from 2018.
Prison sentences of less than two years are often suspended by judges in Spain, but only if the convicted person has a clean record.
Most expensive player
Despite the pressure of the legal proceedings, injury-prone Hernandez has had his best spell as a Bayern player of late and coach Julian Nagelsmann had backed him, saying there was "no feeling that this has burdened him."
The Bundesliga's most expensive player at 80 million euros (93 million dollars) is set to feature in the German Cup second round game at Borussia Moenchengladbach later on Wednesday.
Hernandez and his legal team had been aghast at the Spanish court proceedings. They could not understand how he could be punished for reconciling with his girlfriend and then marrying her following the altercation and restraining order.
An order was also placed on his partner for her role in the violent dispute but did not come into effect because she was not served with the papers prior to their reconciliation.
In Spanish law, reconciliation is often not recognized in restraining order cases because the reconciliation could have been forced.
Last week Hernandez had to dash from a Bundesliga game in Leverkusen on Sunday to a Madrid court on Monday and then to a Champions League game in Lisbon on Wednesday.