DOVER, Del. — A federal appeals court has upheld a judge’s ruling against a former Delaware prison guard who claimed he was fired in retaliation for complaining that he was the subject of illegal job discrimination.

The court on Thursday affirmed a federal judge’s 2015 ruling in favor of Department of Correction officials in a lawsuit filed by Rene Flores.

Flores claimed he was passed over for a promotion to captain in 2011 because he is Hispanic, and that officials later fired him in retaliation for complaining of discrimination.

Officials say Flores was fired because he illegally accessed the state’s criminal database to look up criminal histories of people, including children of other DOC employees and a man who was dating his daughter, then lied when he was questioned about those activities.