John Singleton, writer-director of “Boyz n the Hood” and industry pioneer, who was the first African American to earn an Oscar nomination for best director, has died. He was 51.

Singleton suffered a stroke after experiencing weakness in his legs, and was admitted to the hospital on April 17. He was taken off life support Monday and died a few hours later at Cedars-Sinai Hospital in Los Angeles.

His family issued a statement, saying: “We are sad to relay that John Singleton has died. John passed away peacefully, surrounded by his family and friends. We want to thank the amazing doctors at Cedars-Sinai Hospital for their expert care and kindness and we again want thank all of John’s fans, friends and colleagues for all of the love and support they showed him during this difficult time.” — The Singleton Family.

John Singleton’s Movie-Making Mantra:

He grew up in South-Central Los Angeles, which became the setting for much of his work as a writer and director. He attended USC film school and turned his student thesis into the screenplay for 1991’s landmark “Boyz n the Hood.”

Fresh out of college with no credits under his belt, Singleton boldly insisted he direct the movie when Columbia Pictures approached him about optioning the “Boyz” screenplay. “I wasn’t going to have somebody from Idaho or Encino [Los Angeles] direct this movie,” he recounted at a 25th anniversary screening.

“Boyz n the Hood” starred Ice Cube and Cuba Gooding Jr., in a raw look at life for African-American youths in communities torn apart by drugs and violence. The movie earned Oscar nominations for Singleton for original screenplay and for directing. In addition to being the first black director to land an Academy Award nom, he was also the youngest person to nab a directing mention, at the age of 24.

“As the movie was going along, I was learning how to direct,” Singleton explained at the anniversary screening. “As it becomes more intense and comes on to the third act, the camera work is more and more fluid, because I’m getting better and better — and taking more chances.”

Roger Ebert wrote on its release, “By the end of ‘Boyz n the Hood,’ I realized I had seen not simply a brilliant directorial debut, but an American film of enormous importance.”

He then moved into music videos, directing Michael Jackson’s “Remember the Time” with Eddie Murphy, Iman and Magic Johnson.

Singleton went on to direct such films as “Poetic Justice” (1993), “Higher Learning” (1995), a remake of “Shaft” (2000) and the second installment of the “Fast and Furious” franchise, 2003’s “2 Fast 2 Furious.”

Singleton, who had said he was profoundly affected by the death of Tupac Shakur, had signed on to direct the “All Eyez on Me” Tupac biopic, but left the project due to creative differences.

He was vocal about Hollywood’s poor track record in recruiting black filmmakers to tell black stories. At a Hollywood Masters talk at Loyola Marymount University, Singleton said, “If you’re doing a story that is African-American-themed, you have to have black people on that can give you advice that are not insecure — they are not just there to show their damn face. That actually can challenge and listen and say, ‘Maybe you should think about this,’ in the development process. That kind of thing.”

As a producer, he shepherded films including Craig Brewer’s “Hustle & Flow” and “Illegal Tender.”

“There’s hardly any precedent for a guy like me to have the career that I’ve had,” Singleton told Variety in 2017. “Because I grew up the way I grew up, I’m an in-your-face kind of guy. I developed that as a defense mechanism to survive in the streets. I do that in Hollywood in the service of my passion.”

Singleton turned his attention to working in TV in recent years as his filmmaking opportunities became narrower and less interesting to him. He earned an Emmy nomination for directing the powerful “The Race Card” episode of FX’s 2016 miniseries “The People v. O.J. Simpson: American Crime Story.”

“I got them in a room. I said, ‘It’s an L.A. story. I’m from L.A. I met O.J. I gotta be part of this,’” Singleton said. “I said, ‘You guys gotta get this right. You have to have a real black perspective on this — you can’t just whitewash it.’”

Singleton left the room with a commitment that led to his directing the episode “The Race Card,” an unflinching look at the racial politics in play during Mark Fuhrman’s testimony and the defense team’s “redecorating” of Simpson’s Brentwood home for the jury’s visit. That episode of the much-lauded series landed Singleton nominations for an Emmy and Directors Guild Award.

The following year he launched two drama series, BET’s “Rebel” and FX’s “Snowfall.” “Rebel,” which revolved around a savvy female detective, lasted one season. “Snowfall,” which examines the rise of the crack cocaine epidemic in Los Angeles in the early 1980s, has been renewed for a third season to air in 2019.

He also directed episodes of “Billions” and “Empire.”

Singleton is survived by five children.

Ryan Coogler on Seeing “Boyz n the Hood” For The First Time: