The man accused of killing a woman by driving his car into a crowd of anti-racist protesters in Charlottesville, Va., was obsessed with Adolf Hitler and the Nazis as a child — and later joined the Army but didn’t last long, according to reports.

James Alex Fields Jr., 20, freaked out the faculty at his high school in suburban Union, Ky., by spewing white-supremacist beliefs, one of his history teachers said Sunday.

“He was basically espousing, you know, Nazi-type ideals,” Randall K. Cooper HS teacher Derek Weimer told Cincinnati TV station WCPO. “It was very alarming.”

Weimer, who taught Fields as both a junior and senior, also recalled him turning in a deeply researched paper that was essentially a “big lovefest for the German military and the Waffen-SS.”

Weimer told The Washington Post he tried in vain to steer Fields away from his “fascination with Nazism” and “big idolatry of Adolf Hitler.”

“This was something that was growing in him,” Weimer said. “I admit I failed. I tried my best.”

A former classmate said Fields’ racism dated back even further, recalling repeated incidents at Ockerman MS in Florence, Ky., where “he would scream obscenities, whether it be about Hitler or racial slurs.”

Caitlin Robinson told The New York Times that Fields — who stood among a group of Nazi-inspired fascists before Saturday’s fatal crash — was “exceptionally odd and an outcast to be sure.”

“He wasn’t afraid to make you feel unsafe,” Robinson said.

A neighbor who lives across the street from Fields’ mother told the Toledo Blade that she often heard him blasting polka music inside his car when he lived in the Maumee, Ohio, town-house development.

Fields’ mom, Samantha Bloom, posted to Facebook on Aug. 17, 2015, that her son “just left for boot camp,” and military records show he entered the Army on Aug. 18, 2015, according to the Times.

But his active duty ended on Dec. 11 that same year, for reasons that weren’t immediately clear.

Bloom was holed up in her home Sunday and refused interview requests.

Fields’ military records conflict with the recollection of Weimer, who said he was rejected by the military due to a history of mental illness.

“Senior year, he was real gung-ho on joining the Army and . . . toward the end of the year found out that he was denied and it was because of a history of anti-psychotic, you know, medication that was prescribed,” he said.

Fields’ namesake father was killed by a drunken driver a few months before his son’s birth, and left him a trust fund administered by an uncle — who revealed the information on condition of anonymity, according to The Washington Post.

“When he turned 18, he demanded his money, and that was the last I had any contact with him,” the uncle said.