A Berwick man shot and killed himself during a standoff with police early Saturday at his home, according to Maine State Police.

Jared Greenlaw, 25, had barricaded himself inside the home on Long Swamp Road, police said.

The incident was touched off by a shooting at 11:35 p.m. Friday at Trackside Tacos in Somersworth, New Hampshire. Greenlaw fired a handgun at another man and then fled the scene, police said. The man was not hit.

Somersworth police issued warrants for Greenlaw’s arrest on charges of second-degree attempted murder, first-degree assault and reckless use of a firearm.

Greenlaw barricaded himself inside his home at 196 Long Swamp Road, police said. Berwick police and the Maine State Police tactical unit surrounded the home and shut down Long Swamp Road about 4 a.m. Saturday. South Berwick police were also at the scene.

Police heard a gunshot from inside the home about 7 a.m. They entered the home and found the man’s body at 10 a.m., said Stephen McCausland, spokesman for the Maine Department of Public Safety.

According to Greenlaw’s Facebook page, he was a Marine Corps veteran who left the military in May 2015.

A Jeff Greenlaw posted Saturday on the Berwick Police Department’s Facebook page, saying: “I know that my son’s actions caused you all alarm. My son was a gentle, kind hearted soul. I’m begging the community to come out and show support for our veterans who suffer from depression.”

The state medical examiner’s office is performing an autopsy. Police are continuing to investigate and have asked anyone with information to contact the Somersworth police at 603-692-3131 or Berwick police at 698-1136.