The home of Dick and Jody Vilardo on May 11, 2015, the day after they were killed. (Dan Morse/The Washington Post)

Mortally wounded, Dick Vilardo stumbled down the rear hallway of his suburban Maryland home just after midnight, hoping to reach his wife of nearly 40 years, Jody.

He saw her in the kitchen, struggling with a masked intruder for control of a phone.

Dick Vilardo, 65, grabbed the intruder, a man less than half his age and armed with a large knife.

But Vilardo was too weakened, and the intruder was too bent on murder.

Details of the gruesome attack that killed the Vilardos were spelled out Tuesday during a two-hour court hearing in Montgomery County Circuit Court in which Scott Tomaszewski pleaded guilty to murder in the May 2015 slayings inside the couple’s home on Ridge Drive, about 12 miles northwest of the District.

Scott Tomaszewski ( Montgomery County Police)

Tomaszewski, 32, a longtime neighbor of the Vilardos, is scheduled to be sentenced Nov. 15.

About 140 people were in court Tuesday, many of them friends and family of the Vilardos, who left behind two children, two grandchildren and a motto they had lived by: Friends are family, and family is everything.

“Dick Vilardo, in his last act on earth, was trying to save the woman he loved,” said Montgomery’s top prosecutor, John McCarthy.

The murders, on Mother’s Day, attracted considerable attention.

Immediately after the killings, Tomaszewski slipped off for a planned Alaskan cruise with his parents. Detectives caught up to him nearly a week later in Juneau, apprehending him as he got off the Coral Princess ship for a day of whale-watching.

His attorney, John Kudel, had spent much of the time since Tomaszewski’s arrest exploring a possible insanity defense. But he couldn’t establish that profound mental illness was responsible for the murders and accepted a plea deal with prosecutors last week. Under the deal, prosecutors can still seek a life sentence with no chance of parole — the maximum penalty for murder in Maryland — and have said they will do so.

The precise motive for the murders remains elusive. The son of retired employees from the National Institutes of Health, Tomaszewski had previous convictions for possession of drug paraphernalia and driving while impaired. He’d also had trouble holding a steady job.

Richard “Dick” Vilardo and Julianne “Jody” Vilardo were killed at the their Rockville-area home in 2015. (Courtesy of the Vilardo family)

“I don’t think there’s any rational explanation for the conduct of the defendant in this case. . . . There’s no rational explanation for this,” McCarthy said.

In April 2015, Tomaszewski had broken into another neighbor’s empty home and stolen jewelry.

When Tomaszewski broke into the Vilardos’ home, he was armed with two knives, McCarthy said.

Tomaszewski attacked Dick Vilardo as he slept and then continued the stabbings in different parts of the house.

Dick Vilardo suffered dozens of wounds. Jody Vilardo fled from the bedroom and was attacked in the kitchen. It was only after attacking the couple, McCarthy said Tuesday, that Tomaszewski stole cash and more than $7,000 worth of jewelry.

Before the killings, Tomaszew­ski sent a message on his phone to his ex-girlfriend, asking: “U don’t have a hockey mask i can borrow, do u? I need to get some work done.” Then, in the minutes after the killings, he went into the Vilardos’ refrigerator and got a ginger ale because his throat was parched.

He returned to his parents’ home next door and threw a black mask, gloves, clothes and sneakers into a washing machine.

Around 3 a.m., he headed to the airport with his family for the Alaska cruise.

Before boarding the plane, he posted a Facebook message at 6:14 a.m.:

“Happy Mothers day to my wonderful mom,” he wrote. “. . . Happy mothers [day] to the rest of you mommies out there as well.”

For the Vilardo children — Andrew and Katherine — May 10, 2015, had started with great promise. They had plans to meet their parents for a Mother’s Day brunch, and when the couple didn’t show up and didn’t reply to messages, their children drove to their parents’ home.

In court, McCarthy played a 911 call placed by Katherine. She is heard in utter panic, telling the operator about finding her parents’ bodies. As the call was played, the Vilardo friends and relatives looked down, and many cried.

“There’s blood everywhere!” Katherine Vilardo said during the 911 call.

After Tomaszewski’s arrest in Alaska, police searched his stateroom and found a folding knife, later shown to bear Dick Vilardo’s DNA.

They also looked at the contents of his smartphone, where they saw a photo he had taken of a large knife shaped like a machete. Believing that was the murder weapon, detectives got a search warrant for his parents’ home.

The detectives told Tomaszewski’s mother what they were looking for, and she told them she may have taken the knife to a trash dump, according to McCarthy. His mother added that after returning from Alaska, she had found a backpack in the house with the knife and jewelry that was not hers or her husband’s. She said she took the items to the dump.

McCarthy said he did not press for charges against Tomaszewski’s mother, choosing instead to secure her as a potential witness against her son if the case had gone to trial. Kudel, the defense lawyer, said that Tomaszewski’s mother agreed to cooperate with authorities.

Since the killings, Tomaszewski has come to better understand exactly what he did, according to Kudel. “Time has allowed him to reconstruct the event. He’s shocked at what he did,” Kudel said.

“He feels as bad as any right-thinking human being can feel,” Kudel added.

After his client’s arrest, Kudel signaled that he would be looking into Tomaszewski’s mental health. Under Maryland law, if someone is so mentally ill that he doesn’t realize he is committing a crime, he can be found legally insane and be sent to a psychiatric hospital rather than to state prison.

Court records indicate that Kudel explored whether a 2014 accident could have damaged Tomaszewski’s brain. The attorney retained a neurologist to review medical records from his client’s fall into a family swimming pool.

On Jan. 8, Kudel entered an insanity plea for Tomaszewski. The plea is known as “not criminally responsible.”

Circuit Judge John Debelius ordered Tomaszewski to undergo a psychiatric evaluation at a Maryland state hospital. The details of that evaluation have not been made public.

But by early August, Kudel had started speaking with prosecutors about a possible plea deal, according to court records.

That plea was finalized Sept. 14, according to the court records, and it called for Tomaszewski to be sent to state prison.