By Phil Wahba

OLD BRIDGE, New Jersey (Reuters) - An employee at a suburban New Jersey supermarket opened fire in the store in the pre-dawn hours on Friday, killing two co-workers and then taking his own life, a prosecutor said.

The 23-year-old shooter, identified as Terence S. Tyler by a police source, was on a night shift at the Pathmark grocery when he left the store about 3:30 a.m. EDT. He returned shortly after with an AK-47 automatic rifle and a handgun, Middlesex County Prosecutor Bruce Kaplan told a news conference.

Shots were heard inside the supermarket in Old Bridge, about 35 miles from New York City, just as employees were preparing to open the store for business.

The two victims, identified as an 18-year-old female and a 24-year-old male, were Pathmark employees and were among a dozen workers in the store at the time. They were shot in separate areas of the store, Kaplan said.

"He entered the store firing his weapons," and magazines were found scattered around the store, Kaplan said.

Old Bridge Mayor Owen Henry described the suspected shooter as a former Marine and a disgruntled worker who had been employed by Pathmark for just a few weeks, the Star-Ledger newspaper reported.

A Marine spokesman said a rifleman by the name of Terence S. Tyler from Brooklyn had served between 2008 and 2010, but was never stationed overseas.

The incident came just a week after an unemployed New York City man shot and killed a former co-worker near the Empire State Building before being shot dead by police.

"SUMMER OF SHOOTINGS"

In July, a gunman opened fire in a crowded Colorado movie theater, killing 12 people; and earlier this month a white supremacist opened fire in a Sikh temple in Wisconsin, leaving seven people dead.

"It's unbelievable. This is the summer of shootings," said Hany Tawfick, 24, who described himself as a friend of the male Pathmark victim.

Kaplan, the prosecutor, said he could not confirm details about the shooter beyond his age.

A Facebook page for a Terence Tyler, which lists matching dates of service in the Marines, says his favorite movies were Bad Boys and Bad Boys II. Music he liked ranged from "Old school hip hop" to Hannah Montana.

A slogan used in place of a Facebook profile picture reads, "Be optimistic all the people you hate are eventually going to die." It is followed by a smiley face.

Hours after the shooting, the store remained closed and police had blocked off one of the roads leading up to the shopping plaza that houses the Pathmark.

"We express our deepest sympathies to the families of the victims and our appreciation to local law enforcement. Our main concern is the safety of our associates and customers," Pathmark said in a statement.

Local residents expressed shock that violence had come to their community.

"It's a quiet neighborhood," said Maritza Hernandez, whose daughter works as a cashier at the Pathmark but was not at the store when the shooting occurred.

"This is insane. I am shaken up," said Dragan Jovanovic, 46, the manager of a nearby Staples office supply store. "As a manager, you think about it. You think about your own staff."

Ricky Stevens, 26, who lives several doors down from the brick apartment building where Tyler lived, said he could not think of anything unusual about him and that he was neither friendly or unfriendly.

"This is something you see on TV Never thought (I'd) see it here," Stevens said.

(Additional reporting by Phillip Stewart; Writing by Edith Honan; editing by Paul Thomasch, Todd Eastham, and Christopher Wilson)