SAUGUS, Mass. — A Lynn man has told authorities he cut the throats of his mother and grandmother, who were both found dead near a Massachusetts school, according to court documents.

Joseph Wright, 23, of Lynn was captured Tuesday after he attempted to free to Canada.

He agreed during a hearing Wednesday to return to Massachusetts to face murder charges in the deaths of his mother Donna Breau, 54, and his grandmother, Melba Trahant, 83.

Wright was taken into custody Tuesday after he crossed from Maine into Canada at about 5 p.m.

Investigators said he tried to flee in his vehicle when officials on the Canadian side of the border tried to question him, said Shelbe Benson-Fuller, spokeswoman for the U.S. Customs and Border Protection.

Wright then abandoned his vehicle about two miles from the border and ran into the woods before the Royal Canadian Mounted Police caught him, she said.

Authorities took Wright to Houlton, Maine, on Wednesday. During a brief hearing before a judge via video conference, he agreed to return to Massachusetts.

Exactly when he is returned depends on Massachusetts State Police, who will return him to the state, said Kurt Kafferlin, assistant district attorney in Maine’s Aroostook County.

Wright lived with his mother in Lynn, one floor above Trahant. He told authorities he left the knife at Trahant’s apartment, according to an affidavit filed in Lynn District Court.

Wright was driving Trahant’s car when he crossed into Canada. Investigators said they found blood at the residences, on the car’s windows and rear fender, and on Wright’s undershorts.