While training to become a Glen Ellyn police officer in 2016, Frank Fazio III used an ethnic slur against Mexicans, calling them “beaners” in front of colleagues in an attempt “to be funny,” records obtained by the Chicago Sun-Times show.

Two months later, Fazio, who is white, resigned rather than be fired after making another “inappropriate comment,” this time during a traffic stop, records show.

Despite that, Fazio was hired earlier this year by the police department in Melrose Park, where the population is roughly three-quarters Latino, predominantly people of Mexican descent.

Less than two weeks after he was hired, a $1,250 campaign contribution was made from his address in his name to Mayor Ron Serpico, records show. It was among Serpico’s biggest campaign contributions this year.

A Melrose Park village spokesman says the suburb’s police and fire commissioners made the decision to hire Fazio once Sam Pitassi, the police director, said there was a vacancy.

The spokesman says there was no quid pro quo but says Serpico, who appoints those commissioners, now plans to donate $1,250 to a food pantry to avoid “any perception of impropriety.”

In a written statement, Serpico says Melrose Park is “a welcoming place for immigrants and minorities” and that the Glen Ellyn accusations against Fazio “are concerning” and now will be looked into.

Fazio didn’t return calls seeking comment. Nor did Pitassi.

In August 2016, Fazio was a Glen Ellyn Police Department recruit, training at the department’s offsite police academy when another trainee, referring to the carpooling the recruits had to do from the shooting range, made a comment about being “packed in the cars like a bunch of Mexicans,” records show.

Another recruit threatened “she would report it” if the man didn’t “self-report his conduct” to the training academy staff, records show. So he did.

Sometime later, two Glen Ellyn officers who were at the academy for a recertification class took recruits to dinner, and the man who’d admitted making the carpooling comment also acknowledged that to the officers, the records show.

Fazio then said his colleague actually had used the word “beaners,” according to the records, which say, “This appeared to be an attempt by Fazio to be funny,” and note that one of the people at dinner is Hispanic.

Word got back to Glen Ellyn’s assistant police chief, who told Fazio he “found his comment . . . to be completely unacceptable” and “worse than the original comment” the other recruit had made, records show.

Fazio “seemed to be somewhat surprised and could not come up with a reason as to why he made the comment,” according to the records, which say he “never considered” his remark might offend the Hispanic man with them “because he wasn’t speaking directly” to him.

Fazio “apologized for his comment and assured me it would not happen again,” according to a memo from the assistant chief.

Then, in October 2016, the assistant chief discovered a problem with Fazio regarding a traffic stop.

“The subject of the traffic stop was an African American male that claimed to be a sovereign citizen,” according to Glen Ellyn records, referring to a group the FBI describes as “anti-government extremists who believe that even though they physically reside in this country, they are separate or ‘sovereign’ from the United States . . . [and] believe they don’t have to answer to any government authority.”

According to a police “in-car audio/video system” that was recording during the traffic stop, Fazio responded by saying, “These f----- people.”

Fazio was told by the assistant chief that, as a result of the training academy incident and “the recent comment during the traffic stop, he seems to display an insensitivity that is unacceptable.” Fazio also was admonished for other problems, including a “late arrival” to the shooting range and his repeated “failure to turn on the car headlights at night.”

Given the option of resigning or being fired, he resigned, records show.

Then, as of Jan. 7, he was hired as a $45,000-a-year cop in Melrose Park.

On Jan. 19, Serpico’s campaign fund reported a $1,250 contribution from “Frank Fazio III” in Chicago, according to Illinois State Board of Elections records, which show the address listed was where Fazio was living while working in Glen Ellyn.

Melrose Park officials say they were unaware of Fazio’s troubles in Glen Ellyn. They blame Glen Ellyn officials, saying they didn’t tell them about what had happened during an employment check.

Melrose Park officials couldn’t say whether they asked for or got Fazio’s Glen Ellyn personnel file, which details what happened there. Nor could they say whether anyone followed up on Fazio’s written comment on his Melrose Park employment application about his time with Glen Ellyn: “I was asked to resign.”