It was none other than Nation of Islam leader Louis Farrakhan who tried to dissuade Sheila Abdus-Salaam from continuing her law studies at Columbia University.

He publicly upbraided her and another female student during a service at a Harlem mosque, mocking the African-American “sisters” for attending “white” universities that he called bastions of the “devil.”

It was the mid-1970s, and law student Abdus-Salaam, then known as Sheila Turner, and a friend had just applied to become members of the Nation of Islam.

“It wasn’t about religion,” recalled the friend, Paula Madison, from her home in California last week. “We shared a passion to better our communities and for us, the Nation of Islam was an organization that we felt we could work within.”

Despite the dressing-down in front of some 400 people, Abdus-Salaam laughed it off. She continued at Columbia Law School, where former US Attorney General Eric Holder was one of her classmates.

The irony, according to Madison, was that after the service, “a staggering number of brothers” sought out Abdus-Salaam for legal advice.

And she helped all of them, Madison said.

Abdus -Salaam, who became the first African-American woman to be appointed to the Court of Appeals, New York state’s highest court, was found dead in the Hudson River nearly two weeks ago. The NYPD had initially believed they were dealing with a suicide, and still lean toward that conclusion, but last week said they would treat the death as suspicious.

They say they don’t know how the judge, clad in sneakers and workout clothes, ended up in the water. An autopsy revealed she had water in her lungs, an indication that she was still alive when she hit the water. It also showed, The New York Times reported Saturday, that her neck was bruised. Officials said the bruising raises the possibility she had been choked sometime — even days earlier — before entering the river, or the bruising could have occurred during the body’s retrieval.

Cops said she was spotted on footage from a security camera on West 131st Street near her Harlem brownstone late on the evening of April 11, and appeared to be heading toward the river, a half-mile from where she was discovered in shallow water on the afternoon of the next day.

Friends and family members contacted by The Post say they are shocked by the judge’s death. And many of them say they simply don’t believe that the “very positive” 65-year-old woman, “a friend to all of her friends,” who loved nothing better than to dance and sing all night, could have taken her own life.

‘Sheila never drank, she never smoked, and she was a vegetarian, but boy did she like to dance.’ - Paula Madison

“She was a wonderful person with a great sense of humor,” Sharif Abdus-Salaam, the judge’s first husband, told The Post last week. “I just don’t believe she killed herself.”

But one friend, who spoke with her several weeks before she died, said she sounded tired, and had confessed she was having trouble sleeping — although she was still making her customary treks to the nearby Harlem YMCA, where she regularly swam laps.

Other friends suggested that she struggled with the pressure of a heavy caseload and speaking engagements, the Times reported.

Those who knew the judge understood that April was a bittersweet month for her. It was in April 2014 that her beloved, younger brother Benny committed suicide after a long and very painful battle with cancer. Her mother, 92, died in April two years earlier of natural causes. Authorities had initially and erroneously said it, too, was a suicide.

Yet she had also reached the pinnacle of her legal career in the month of April, in 2013, when Gov. Cuomo nominated her to the seven-member state Court of Appeals after the death of Judge Theodore T. Jones.

After her death, Cuomo called Abdus-Salaam “a trailblazing jurist whose life in public service was in pursuit of a more fair and more just New York for all.”

But while focused and committed in the courtroom, her personal life was tumultuous at times. A painful battle with cancer in her late 30s had dissuaded her from having children. She had divorced three husbands, the last one in 2005 in a “contested” legal battle that dragged on for two years. And last summer, she married Gregory Jacobs, her fourth husband and a fellow Columbia alum with whom she had recently reconnected.

Sheila Turner was born on March 14, 1952, in Washington, DC, where her working-class parents toiled as government bureaucrats. The great-granddaughter of a slave, she was raised a Catholic and was close to her six brothers and sisters and her mother.

She told interviewers that she first became interested in the law after watching episodes of “Perry Mason,” and became determined to become a lawyer at 13, when the crusading civil rights attorney Frankie Muse Freeman paid a visit to her public school to discuss the movement.

“She was riveting,” said Abdus-Salaam in a 2012 profile in Columbia Law School Magazine. “She was doing what I wanted to do: using the law to help people.”

After high school, she went to Barnard College, where she earned an economics degree in 1974. There, she became a student activist and even sued the state Board of Regents to maintain all-black dorms at elite colleges. She herself lived in an all-black “corridor” in a Barnard dorm. And though the lawsuit fizzled when the lead plaintiffs in the case graduated, it was an early sign of Abdus-Salaam’s focus and determination, a friend told The Post.

Despite being a serious student, she loved to have a good time, recalled Madison, who came to the city from upstate Vassar College to attend James Brown concerts with Turner when they were in their early 20s.

“Sheila never drank, she never smoked, and she was a vegetarian, but boy did she like to dance,” said Madison.

Turner graduated from Columbia Law School in 1977 and married college boyfriend Ed Michael, who had changed his name to Sharif Abdus-Salaam after joining the Nation of Islam.

“When she finished law school, she didn’t go into a big corporation like a lot of law-school graduates; she went to help poor people with their needs,” Sharif Abdus-Salaam told The Post.

Sheila Abdus-Salaam’s first job was representing the poor in landlord-tenant disputes and immigration matters in Bushwick, Brownsville and East New York, as a lawyer at Brooklyn Legal Services. In the early part of her career, she won an anti-discrimination case for a group of women bus drivers in the city who had been denied promotions.

Although Abdus-Salaam would eventually leave the Nation of Islam and divorce her first husband after seven years of marriage, she kept her Muslim last name, which translates as “Servant of the all peaceable” in Arabic.

“Philosophically, surnames were not important because the names our fathers got were passed down from slave owners,” said Madison, who remained a close friend for more than 40 years.

After the divorce, Abdus-Salaam also kept the Harlem townhouse that she had bought for $6,000 in 1980 with her former husband, according to public records.

The house held special significance for Abdus-Salaam. As a newly minted crusading lawyer, she was determined to help save the historic black neighborhood, which had hit such hard times by the late 1970s that the city was offering to sell abandoned homes for $1.

According to Madison, Abdus-Salaam went door-to-door trying to convince desperate owners to sell their homes in the then-graffiti- and garbage-strewn neighborhood.

Residents who could no longer afford to pay city taxes were abandoning their homes. For the building that was to become her home, Abdus-Salaam offered to pay the overdue taxes on 113 West 131st St., a narrow, three-story brownstone, in addition to offering several thousand dollars for the property, which was exponentially more than the owners could hope to get from the city, Madison told The Post.

“We were not legacy kids,” said Madison, who was raised by a single mother on welfare in Harlem. “We grew up poor and the best asset we had was our brains.”

When Abdus-Salaam decided to become a judge, she began attending political events in the neighborhood, where she met her second husband. Transit Authority manager James Hatcher was the son of Andrew Hatcher, an associate press secretary to President John F. Kennedy and the founder of 100 Black Men of America, a civil-rights group.

In 1990, the couple bought a townhouse on Striver’s Row, a cluster of elegant townhomes on 138th and 139th Streets in Harlem that were built in the 19th century for the city’s elite. A year later, the home was used as a set in Spike Lee’s film “Jungle Fever.” Six years after that, in 1997, Hatcher filed for divorce.

Madison told The Post that, as with Abdus-Salaam’s first divorce, there was no animosity and the couple had simply drifted apart.

By then Abdus-Salaam was already four years into her tenure as a state Supreme Court justice.

And while her career was steadily rising, her personal life appeared fraught. She waged a very painful battle with uterine cancer, although she was surrounded by friends and family, including nieces and nephews and her long-term tenant and closest friend, Donna Knight.

When her health improved, Abdus-Salaam began to take regular trips, including an African safari with a group of 10 female friends, including Knight and Madison.

“Starting in about 1991, a group of us started having regular get-togethers, like slumber parties, at our homes,” recalled Madison, who worked as a news director at NBC and later became an executive vice president at the network.

Things also started to look up for Abdus-Salaam when she began considering renovations to her first townhouse on West 131st Street. She hired a contractor, Hector Nova, and soon started dating him. They married and bought a country home in upstate Warwick.

By 2003, Abdus-Salaam wanted out of the union and initiated divorce proceedings against Nova, leading to a protracted legal battle that lasted two years, according to public records obtained by The Post. Nova did not return repeated calls seeking comment.

Despite the divorce, Abdus-Salaam’s career kept rising. In 2009, Gov. David Paterson named her as a justice to the Appellate Division of the New York Supreme Court, First Judicial Department.

But it was on the Court of Appeals where Abdus-Salaam recently made one of the most important decisions.

Last August, in a seminal ruling, she expanded the definition of what it means to be a parent in New York state, overturning a 1991 ruling that nonbiological parents in a same-sex union had no standing to seek custody.

She wrote, “where a partner shows by clear and convincing evidence that the parties agreed to conceive a child and to raise the child together, the non-biological, non-adoptive partner has standing to seek visitation and custody.”

In the months that she toiled over the ruling, Abdus-Salaam took time out last June to marry the Rev. Gregory Jacobs at the Greater Newark Conservancy.

It was Jacobs who first alerted the police from his home in Newark after Abdus-Salaam did not show up for work on April 12.

The newlyweds spent their weeks apart, with Jacobs living at his home in Newark, where he works at the city’s Episcopal Diocese. They spent alternate weekends at each others’ homes, Madison said. Now, Jacobs and all of Abdus-Salaam’s friends are on lockdown. Grief-stricken, they are refusing comment until there is more information about the cause of death, although no one can quite bring themselves to accept that Abdus-Salaam may have committed suicide.

As Jacobs noted in a public statement last week, “Those of us who loved Sheila and knew her well do not believe that these unfounded conclusions have any basis in reality.”