Updated

The Maine deputy who was killed last week was shot in the head by a suspect who had a bulletproof vest, according to court documents released Monday.

John Williams, 29, confessed to a friend after killing 61-year-old Somerset County Cpl. Eugene Cole in Norridgewock, investigators said in a state police affidavit as Williams made an initial court appearance.

The affidavit obtained by WGME stated a Somerset County Sheriff pickup truck drove by as friends were dropping Williams off in front of his previous home in Norridgewock shortly after 1:15 a.m. The friends had witnessed Williams put bags, a bulletproof vest, and a shotgun into the car before taking him to the home.

55fdfde4-Maine Cop Split 1

John Williams, left, is accused of killing Somerset County Cpl. Sheriff Eugene Cole in Maine. (Maine State Police/Somerset County Sheriff's Office)

About 15 minutes later, his friend Chris Williams stated in the affidavit, “He (John Williams) had killed Corporal Gene Cole and stole his police cruiser after Cole snuck up on him, or he snuck up on Cole. The friend couldn't remember,” according to the affidavit.

It was not clear how Williams and Cole encountered each other.

The 29-year-old then allegedly drove Cole's cruiser to a Cumberland Farms convenience store, where he stole a pack of cigarettes and fled before abandoning the cruiser.

Maine Suspect 1

John Williams, right, accused in the fatal shooting of Somerset County Sheriff's Deputy Eugene Cole, sits with his attorney Patrick Nickerson during his initial court appearance on a murder charge, Monday, April 30, 2018, in Auburn, Maine. (AP Photo/Gabor Degre)

After the shooting, Chris Williams told police he picked up his friend and the two smoked drugs using a "crack pipe." Chris Williams told police he gave John Williams his cell phone, and then kicked him out of the vehicle, according to WGME.

Cole's body was not discovered until 7:30 a.m., sparking a massive manhunt with more than 200 law enforcement officers pouring into the area in central Maine, along with tactical vehicles and helicopters.

MAN WANTED IN MAINE DEPTUTY’S SLAYING WAS ARRESTED WITH THE FALLEN OFFICER’S OWN CUFFS

Authorities have still not disclosed how or why Williams crossed paths with the sheriff's deputy, but the 29-year-old was due in court in Massachusetts the day of the shooting and had talked to a friend about becoming a fugitive.

Maine Suspect 2

Maine State Police detectives lead John Williams to a police cruiser Saturday, April 28, 2018, on Norridgewock Road in Fairfield, Maine, following a four-day manhunt. (David Leaming/Waterville Morning Sentinel via AP)

Friends said he had been frustrated by his arrest in Massachusetts the previous month and by his girlfriend's arrest in Maine days earlier — in which Cole had been involved.

Williams was not required to enter a plea Monday, and a judge ordered him held without bail. The judge ordered a mental health evaluation and, at the request of attorneys, moved future court proceedings from Somerset County to Portland to ensure that Williams gets a fair trial, according to the Associated Press.

WOMAN WHO FOUND SLAIN COP IN HER YARD IN MAINE HELPED RAISE SUSPECT

Several of Cole's family members, including his wife and son, attended the hearing but left without talking to reporters.

Maine Shooting 2

Officers work the scene of a shooting at a Cumberland Farms convenience store in Norridgewock, Maine, Wednesday, April 25, 2018. (Lexie O'Connor/WGME via AP)

Cole's wife, Sheryl, posted on Facebook to thank people for their kindness and law enforcement officials for their service, adding that "the last five days have been the purest form of hell and torture."

She said her husband talked about the "crazies" being out on the night he was killed, but that nothing seemed to be out of the ordinary when he headed out to work.

"Anyway, we said our ritual goodbye, ending with me saying (or yelling ) 'Be safe.' and him responding 'Absolutely,'" she wrote. "The next time I saw my husband, he was laying in a casket."

The Associated Press contributed to this report.