At the door, Gilbert told his elated mother he needed time alone with his father to discuss business.

Less than five minutes later, his father, Thomas Gilbert Sr., a 70-year-old hedge fund manager, lay dead on his bedroom floor, shot in the head.

On Friday, a jury in Manhattan found Gilbert guilty of second-degree murder, rejecting an insanity defense after two days of deliberation.

Gilbert stared straight ahead with no expression as the foreman read the verdict and one by one the six men and six women of the jury affirmed the decision. He faces 25 years to life when Justice Melissa Jackson sentences him Aug. 9.

His lawyer, Arnold Levine, had argued that the shooting was the act of a mentally ill man who was too impaired to comprehend what he was doing. Prosecutors had countered that Gilbert was a ungrateful son — angered because his father had cut him off financially — who had planned the murder after purchasing a pistol in Ohio seven months earlier.

Levine said he planned to appeal. “Someone like Tommy doesn’t belong in state prison,” he said. “He needs to be in a psychiatric hospital.”

The murder four years ago of Gilbert’s father, a well-known figure in Manhattan and the Hamptons, stunned New York’s high society.

During the five-week trial, prosecutors painted a portrait of a troubled young man, born with many advantages in life, who failed to make his own way and then developed an irrational anger toward the father who had supported him with a weekly $1,000 allowance.

Gilbert, 34, attended private boarding schools on the Upper East Side and in New England, graduated from Princeton with an economics degree and was expected to follow in his father’s footsteps to a lucrative Wall Street career, witnesses said.

His father tried unsuccessfully to bring him into the family business, Wainscott Capital Partners.

But Gilbert never flourished. Instead, he spent years living off his parents while he surfed, traveled the world and attended exclusive social clubs in Manhattan and the Hamptons.

He was diagnosed with several mental illnesses, including obsessive compulsive disorder, depression and schizophrenia, and his parents sought help from doctors who prescribed him medication that he refused to take, according to testimony.

His mother, Shelley Gilbert, recalled on the witness stand feeling delighted when her son, whom she referred to adoringly as Tommy, showed up unannounced at their Turtle Bay apartment on the afternoon of Jan. 4, 2015.

“He came in and told me he wanted to talk to Dad about business, and so I was excited about that,” she said.

She testified that she had not seen her son in months, so she obliged when he asked her to go out to buy him a sandwich and a Coke, a brand of soda he knew his parents never stocked in the apartment.

On her way out, she went to the bedroom where her husband was watching a sports game from his bed.

She quietly put on a pair of sneakers and left the apartment without saying a word to her husband about her son’s arrival. She told the jury she wanted father and son to sort out their differences on their own.

But she changed her mind as soon as she stepped out of the doorman building, thinking the two might need a mediator if they got into a confrontation, she said.

Three minutes later she returned to find her husband lying dead next to their bed, she said. She called 911, and according to a recording played for the jury, when the operator asked who had shot her husband, she replied, “My son, who is nuts.”

The fact that Gilbert asked his mother to go out and buy him a sandwich and a soft drink proved important in deliberations, three jurors said after the verdict.

Although the jurors believed Gilbert struggled with mental illness, the panel came to a consensus that he knew killing his father was morally wrong because he went out of his way to clear the room before committing the crime.

“It was the can of Coke,” said one juror, Julie Thiry-Couvillion, 32, a Broadway wardrobe supervisor. “And also the fact that she offered to make him something there and he said, ‘I’d like you to go out.’ It let us know that he knew what he was doing.”

Levine had tried to convince the jury that his client’s mental illness clouded his sense of reality, preventing him from understanding his actions or knowing they were wrong.

Most notably, he said, Gilbert became obsessed with the idea that random objects, and even people around him, would contaminate him with unknown, toxic substances. As he grew older, his delusions led him to be aggressive toward his father, according to three psychiatrists and a psychologist summoned by the defense.

“It’s mental illness — that’s not the real Tommy,” Levine said during closing arguments. “Tommy Sr. was the object of Tommy’s delusions.”

But prosecutors argued that while Gilbert suffered from conditions commonly treated with medicine, his moral judgment was not impaired.

They portrayed him as an entitled and vindictive son who carefully planned to kill his father when his father followed up on a threat and cut his allowance to $300 a week.

“This defendant didn’t want to grow up and be an adult,” the lead prosecutor, Craig Ortner, said during closing arguments. “When his father tried to push him along in that direction and cut his allowance, he threw the ultimate tantrum.”

To help prove the killing was premeditated, prosecutors called to the stand John Bay Bennett, a former U.S. Navy service member, who told jurors that Gilbert drove 570 miles to rural Ohio to buy a .40-caliber gun that he had advertised on Facebook.

Detectives also asserted Gilbert had placed the pistol in his father’s left hand in a clumsy attempt to make the death look like a suicide.

Ortner, in his summation, said Gilbert acted because he was about to lose his only financial support.

“The timing shows a rationality. It disproves his insanity defense,” the prosecutor said. “A truly insane person kills for no reason at all. They strike seemingly at random times and places. That’s not the case here.”