When police wanted to question a Massachusetts man in connection with his ex-girlfriend’s suspicious death in Vermont, they found him walking in the woods near the crime scene with a knife.

Now he’s dead after a confrontation with officers.

Mary Anderson, a 23-year-old from Harvard, Massachusetts, was last seen alive Saturday evening in Hudson, New Hampshire. According to police. They found her body inside her pickup truck on Elliot Street in Brattleboro Tuesday morning.

Her 34-year-old ex, Matthew Davis, of Fitchburg, Massachusetts, had been wanted for questioning in her disappearance, and then her death. Authorities said they encountered him walking along the road out of town hours after her body had been found.

MISSING MAINE PARENTS AND TODDLER: AERIAL SEARCH COMES UP EMPTY AS DETECTIVES VISIT LAST KNOWN LOCATION

Portraits of Matt Davis and Mary Anderson against a blue backdrop

Matthew Davis was a person of interest wanted for questioning in the death of Mary Anderson, right. (Vermont State Police)

State troopers and local police were canvassing the area when an officer recognized him from a photo, authorities said. 

Police approached to question him and say he was armed with a knife.

"During an attempt to speak with the man about 7:45 p.m., he was shot by police and has been pronounced deceased," state police said in a statement.

Two state troopers and a Brattleboro officer fired their weapons during the encounter, which investigators said took place in a wooded area along Western Avenue.

Landscape view of Battleboro

Brattleboro is a historic town along Vermont's border with New Hampshire. (iStock)

After the shooting, officers rendered aide and called for an ambulance, according to authorities, but Davis died at the scene.

TEXAS LOVE TRIANGLE MURDER SUSPECT KAITLIN ARMSTRONG WAS DATING WHILE HIDING OUT IN COSTA RICA

Police said they recovered a knife near Davis’ body and announced an inquiry into the police-involved shooting, citing standard protocol. 

Vermont State Police Major Dan Trudeau warned during a news briefing Tuesday, before the encounter, that Davis should be considered dangerous, even as he refrained from naming him a suspect in Anderson’s disappearance.

Vermont State Police Major Dan Trudeau holds a news briefing

Vermont State Police Major Dan Trudeau warned during a news briefing Tuesday, before the encounter, that Davis should be considered dangerous, even as he refrained from naming him a suspect in Anderson’s disappearance. (Vermont State Police)

Police in Brattleboro found Anderson dead inside her truck Tuesday morning, according to authorities.

CLICK HERE TO GET THE FOX NEWS APP  

Police were asking area residents to share any surveillance video that may be relevant to the case, especially in the Elliot Street area of Brattleboro.

Anderson’s autopsy was scheduled for early Wednesday, but a spokesperson for the Vermont Chief Medical Examiner’s office said the results were not yet available.