Director Jeff Nichols appeared at the Hamptons International Film Festival Thursday to screen his opening-night film, “Loving,” which stars Joel Edgerton and Ruth Negga as an interracial couple living in the South during the 1960s.

The film is based on the true story of Richard and Mildred Loving, who were married in Washington, D.C., but fought a legal battle to have their union legally recognized in their home state of Virginia. Their case resulted in a landmark Supreme Court decision in 1967, which ruled that state laws banning interracial marriage were unconstitutional. The film, which has been mentioned as an early Oscar contender, opens in theaters on Nov. 4.

advertisement | advertise on newsday

“They came back home to live as husband and wife, and were arrested,” Nichols said of the Lovings. “They were sentenced to a year in the state penitentiary, and that was suspended on the understanding that they had to leave the state for a period of 25 years.”

Nichols, whose credits include the gritty 2012 drama “Mud” and this year’s moody sci-fi film “Midnight Special,” said he agreed to direct “Loving” because he wasn’t familiar with the case, despite having attended Little Rock Central High School in Arkansas, itself a famous battleground for civil rights in 1957. “I knew a lot about that. I graduated in 1997, and so there were all these celebrations and discussions about it. But I didn’t know the Lovings’ story. And that bothered me.”

In an interview before the screening, which was the movie’s U.S. premiere, Nichols noted that his film also had relevance to the recent fight for same-sex marriage. “Just because we have this legal lever to allow people to marry doesn’t mean that society changes instantly . . . I think these kinds of issues are still with us, and they probably will for a long time to come.”

The 24th annual Hamptons International Film Festival continues this weekend and will feature live interviews with Aaron Eckhart, Holly Hunter and Edward Norton.