A still from D.W. Griffith's controversial "The Birth of a Nation."Jerry Tavin/Everett Collection

When her Oscar-nominated civil rights drama “Selma’’ screened at the White House last month, director Ava DuVernay noted on Instagram that “The Birth of a Nation’’ — still the most controversial film in American history — was the first movie ever shown in the presidential residence.

DuVernay explained the irony to a reporter: “D.W. Griffith, a very innovative filmmaker, who craft-wise was at the vanguard of filmmaking [but] was a complete racist, made a film that was epic and very widely embraced in 1915 which was . . . the worst piece of film you will ever see, if you believe in the equality of all people.’’

That the first blockbuster ever made in the United States is still capable of arousing such passion after its premiere 100 years ago Sunday in Los Angeles (under the title “The Clansman’’) is a tribute to Griffith’s groundbreaking skills as a director — and the jaw-dropping offensiveness of a Civil War melodrama that celebrates the founding of the Ku Klux Klan and what film historian Thomas Doherty calls “the triumph of Southern white supremacy.’’

In a climax that had 1915 audiences on their feet cheering, sheet-wearing ex-Confederate soldiers-turned-vigilantes rescue a white woman (Lillian Gish) from a sex-crazed black militia with the help of Union veterans — “former enemies united in their defense of their Aryan birthright,’’ as a title card that draws gasps from audiences today puts it.

Based on a play by Thomas Dixon so notoriously racist it had been banned in several places, “The Birth of a Nation’’ mirrored the attitudes of Griffith, a fellow Southerner who raised an unprecedented $100,000 (outside the nascent Hollywood studio system) for a three-hour spectacular at a time when few American movies ran longer than 20 minutes.

Dixon’s play was set during the post-war Reconstruction period, but Griffith added what amounted to an hourlong prologue that rewrote history by suggesting the North initiated the Civil War, embracing the then-prevalent Southern view that its defense of slavery was a noble “lost cause.” To this day, Griffith’s spectacular depiction of the Battle of Petersburg is still considered one of cinema’s most impressive war sequences.

What makes “Birth’’ most offensive is its depiction of its black characters — all of the prominent ones performed by white actors in blackface — during Reconstruction. Griffith depicts defeated Southerners being terrorized (and even disenfranchised from voting) by illiterate, corrupt and uncouth former slaves (seeking interracial marriage) under the influence of white Northern carpetbaggers. (A view still held by many 1915 historians, but long ago discredited).

The main black character is a “mulatto’’ (an archaic and now-offensive term for a mixed-race person) who becomes a lieutenant governor of South Carolina with the encouragement of his mentor, a Northern abolitionist (based on the real-life congressman who Tommy Lee Jones played in “Lincoln’’) with a black mistress. The abolitionist is horrified, though, when the mulatto announces his plans to marry the abolitionist’s daughter and is grateful when the Klan rescues him and his daughter.

A major theme of “The Birth of a Nation’’ is the supposed dangers that hypersexualized black men pose to white women — with a lengthy sequence devoted to a former slave chasing his former white mistress after she turns down his proposal of marriage. She jumps off a cliff to her death rather than risk being caught — and her outraged brother founds the Klan to bring him to “justice.”

Doherty, a Brandeis University professor who terms the film a “racist masterpiece,’’ says that when he shows it to students today, “the students are slack-jawed at its flat-out projection of American racism. It’s just astonishing to see something that raw and reprehensible. Every frame is designed to uphold the ideology of the white race.’’

Doherty adds that “I always have to explain to my students the scene at the end where the Northern soldiers are holding rifles over the heads of the women while they’re besieged by negroes trying to break into their cabin. The soldiers are prepared to bash the women’s brains out to save them from succumbing to lustful black males.’’

This was understood by audiences in 1915, when “The Birth of a Nation’’ was praised even by most liberal film critics and some black audience members. The National Association for the Advancement of Colored People, founded just six years earlier, mounted protests and went to court in several cities to get the film banned as racially inflammatory.

Vigorously fought by Griffith and his financial backers, the NAACP’s efforts (the roots of the American civil rights movement) were unsuccessful, as “The Birth of the Nation’’ became the “Star Wars’’ of its day.

It was shown in legitimate theaters for admission prices as high as $2 — about $47 in 2015 dollars — instead of the then-prevalent nickelodeons, to the kind of audiences who generally shunned movies as fit only for riffraff. It ran for 44 weeks at the still-extant Liberty Theatre on West 42nd Street — with a 40-piece orchestra performing a score specifically composed for the film, another innovation. By one estimate, Griffith and his partners had collected $4.8 million (around $90 million today) by the end of 1917, when nearly 10 percent of the American population had seen their movie.

The film’s lavish promotional campaign included what is still one of the most famous pull-quotes ever (“Like history written with lightning!”), attributed to President Woodrow Wilson. When Wilson denied ever saying this — historians believe the quote was likely devised by Wilson’s friend and college classmate Dixon — Griffith added title cards with out-of-context quotes from Wilson’s “A History of the American People’’ into his movie (as well as disclaimers that the film was not meant to reflect badly on post-Reconstruction blacks and, for some showings, even a now-lost epilogue showing recent accomplishments of African-Americans).

“The Birth of a Nation” lost popularity by the mid-1920s due to its creaky Victorian plot (a 1930 reissue with a synchronized music score flopped), but it left an ugly legacy that lasted decades: racial strife, a surge in lynchings of black males in the United States and the rebirth of the moribund Ku Klux Klan, which sponsored its own screenings to recruit members. It would be many years before a significant number of Hollywood movies would depict black characters as anything but servile, comical and/or asexual.

“The Birth of a Nation’’ is referenced in countless movies and TV shows. “It’s the film that never goes away,’’ says Doherty. “It’s there in a montage of Captain Dan’s family in ‘Forrest Gump,’ and Peter Bogdanovich’s ‘Nickelodeon’ ends with Ryan O’Neal’s character, a director, attending the premiere of ‘Birth of a Nation’ and realizing [afterward] that American movies have changed forever.’’

Griffith’s once-acclaimed film, which fell into the public domain in 1976, is rarely revived in its entirety anymore (Manhattan’s Film Forum will show it on March 2), though it’s available in multiple versions on video and on streaming sites. Meanwhile, contemporary filmmakers have been turning Griffith’s racist propaganda on its head.

Quentin Tarantino’s “Django Unchained’’ — like Mel Brooks’ “Blazing Saddles’’ before it — mocks the earlier film’s Klan worship, while DJ Spooky’s “Rebirth of a Nation’’ remixes its namesake in subversive ways. And in 2015, the notorious title “The Birth of a Nation’’ is being reappropriated again — for a biography of 19th-century slave-turned-revolutionary Nat Turner from African-American filmmaker Nate Parker.