The judge presiding in the case, Juan Luis Pía, concluded that nobody could be held responsible for the environmental damage caused by the spill because the accident was due to the “deficient state of maintenance and conservation” of the 26-year-old tanker.

Prosecutors had sought a 12-year sentence for Mr. Mangouras, as well as prison terms for two of the Prestige’s officers and the former director general of the Spanish merchant marine department. One of the officers was sentenced in absentia.

Mr. Mangouras was sentenced for ignoring orders to have another ship tow the tanker, which eventually split in two after running into trouble during a storm. After the storm, the stricken Prestige was then kept at sea for almost a week while the Spanish government tried to convince neighboring France and Portugal to offer it shelter. Mr. Mangouras received a nine-month sentence but will not go to jail because he is over age 70 and Spanish law suspends prison terms for sentences of less than two years.

Ana Pastor, Spain’s public works minister, said the government had absolute respect for the court decision. However, some opposition politicians said the court was too lenient. Gaspar Llamazares, a lawmaker from the United Left party, told reporters that Wednesday would be remembered as “a black day for justice” and described the ruling as “a scandal.”

Prosecutors had also demanded financial compensation from the ship’s insurers to cover the environmental costs of the spill. The Spanish state had claimed 4.3 billion euros, or $5.8 billion, the Galician regional government €1.2 billion and France €86 million in damages, since the oil spill reached as far as French beaches. But the court ruled that no such financial compensation was due. The only outstanding issue is whether the ship’s insurer, the London P&I Club, will be reimbursed the €22.7 million bail posted in the case.