A standoff that began with an apparent botched robbery at a McDonald's restaurant ended Monday when 13 people were freed by a SWAT team and two others were found safe in New York City.

No customers or workers were injured. But a masked gunman was found dead in the back of the restaurant from a gunshot he might have received from police, Police Chief Arthur Kelly said.A second gunman was being sought. He had fled in a car with two female hostages. The women, ages 23 and 20, were left in a New York City motel room, bound and gagged, but managed to free themselves and call for help, according to New York police. One of them was a McDonald's employee.

"Our prayers were with those being held hostage," City Council President Brian Gomes said earlier. "We just wanted everything to turn out all right."

Police were called to the restaurant in this city 60 miles south of Boston after a report of two suspicious men at about 9 p.m. As officers tried to talk to them, the men shot at them and police fired back.

As customers and police ran out, the one gunman fled in a car with the two women.

During the standoff, police were able to talk to one person in the McDonald's by cellular telephone but could not contact the gunman still inside, Kelly said. At midnight, SWAT team members opened a door with a key and found the gunman was dead.

"We saw the SWAT team running across the street and they were yelling," said Spencer Strickland, who watched the standoff. "It looked like some kind of a `Miami Vice' episode."

Officers took the customers and workers out and made them lie on the ground and handcuffed them until it was determined a gunman was not among them. They then were bused to the police station for questioning.