By Olga R. Rodriguez and Janie Har | Associated Press

SAN FRANCISCO — The tech consultant charged with the killing of Cash App founder Bob Lee planned the attack, drove the victim to a secluded spot and stabbed him over an apparent dispute related to the suspect’s sister, prosecutors said in a court document released Friday.

The motion to detain Nima Momeni, 38, without bail is the first official accounting of what may have led to the stabbing death of Lee in a deserted part of downtown San Francisco early morning on April 4. Momeni was arrested Thursday and appeared in a San Francisco courtroom Friday but did not enter a plea.

He is now scheduled to be arraigned April 25.

The judge in Friday’s brief hearing agreed to detain Momeni in jail without bail. If convicted, he faces 26 years to life in prison, said the office of District Attorney Brooke Jenkins.

Momeni appeared in court wearing an orange sweatshirt and pants. He did not speak except to say, “Yes your honor,” when the judge asked if he agreed to decline his right to a speedy trial.

His younger sister Khazar Elyassnia sat with her husband, prominent San Francisco plastic surgeon Dino Elyassnia, and two other family members in the front row at the hearing. When Momeni entered the courtroom, an older woman made a heart sign with her hands and Momeni, who was wearing a face mask, smiled and nodded at them.

The family declined to speak to reporters.

Momeni was represented in court Friday by attorney Robert Canny, who told reporters after the hearing, “The facts of what occurred, or didn’t occur, will come out over time.”

On Thursday, San Francisco Police Chief Bill Scott announced Momeni’s arrest and said that the two men knew each other but declined to elaborate on their connection. He also refused to disclose a possible motive.

The motion to detain Momeni relies on surveillance video and testimony from a friend who was with Lee the afternoon and evening before he died. The events that unfolded started the day before, when the friend, along with Lee and Khazar Elyassnia, were drinking together at another person’s apartment, according to the document.

That night, the friend said he and Lee left the apartment. Afterward, they went to Lee’s hotel room, without Khazar Elyassnia, and noticed a conversation in which Momeni was questioning Lee over whether his younger sister “was doing drugs or anything inappropriate,” according to the document. Lee reassured Momeni that nothing inappropriate had happened. It is unclear whether the conversation took place in person or by phone.

The friend and Lee parted ways around 12:30 a.m. Minutes later, Lee can be seen on video surveillance entering the Millennium Tower, where public records show the Elyassnias own a unit. The video also shows Lee and Momeni leaving the building shortly after 2 a.m. and driving off in Momeni’s BMW.

Prosecutors say that Momeni drove to a dark and secluded spot, and attacked Lee with a kitchen knife, stabbing him three times, including once in the heart. He then sped away “and left victim to slowly die,” according to the motion. Police recovered a knife with a 4-inch blade at the scene.

The motion also indicates a text message that Khazar Elyassnia sent Lee to check on him because her brother came “down hard on you” and to thank him for “handling it with class.”

Robert Canny did not return an email and phone message seeking comment on the details released by the prosecutor’s office. Dino Elyassnia did not return emails and messages left at his practice seeking comment. Khazar Elyassnia could not immediately be reached for comment.

The stabbing death of Lee shocked the tech industry, with friends and former colleagues mourning a man they described as brilliant, gregarious and a doting father to his two children.

Lee had recently moved to Miami with his father and was back in San Francisco for business when police found him with stab wounds in the downtown Rincon Hill neighborhood at 2:30 a.m. April 4. He died at a hospital.

Lee is known for creating the widely used mobile payment service Cash App while working as chief technology officer of the payment company Square, now known as Block.

On his LinkedIn profile, Momeni describes himself as an “IT Consultant/Entrepreneur” as well as the owner of a company called Expand IT, described as an information technology consulting business in state filings.

Criminal records show Momeni was charged in 2011 for carrying a switchblade, a misdemeanor offense. The case was dismissed the following year after he took a plea.