A Spanish court has ruled that a civil servant who failed to show up to work for years in the southern city of Cadiz must pay back nearly 27,000 euros ($30,500) in wages.

The ruling says the employee of a city-owned water utility didn't appear at the office for up to six years and "did absolutely no work" from 2007 to 2010 prior to his retirement in 2011.

The ruling issued last month and provided to The Associated Press Friday did not specify how the worker's absence went undetected for so long.

The decision marked the end of legal process lasting years after Cadiz city officials sought the penalty and the worker appealed it.

The ruling says the civil servant cannot be named because of a Spanish privacy law.