SAN FRANCISCO — The Fourth District Court of Appeal ruled Monday that California judges are not entitled to both disability and regular retirement benefits, in a decision that cost one retired San Bernardino judge more than $500,000.

A unanimous panel, ruling on an issue of first impression in California, found retiring judges must either accept disability compensation or collect on the contributions paid into their retirement funds during their years on the bench. Retired Judge Christopher Warner, who served on the San Bernardino County Superior Court bench for 14 years, had argued he was entitled to both. The two funds aren’t linked, he argued, as they are found in two separate sections of the Judges’ Retirement System II Law.