A man who had been barred from a strip club after his relationship with a bartender soured returned early Tuesday dressed in SWAT gear and opened fire, killing two people before being fatally shot, police and the club owner said.

The 35-year-old shooter walked into the Foxy Lady around 2:30 a.m. with a high-powered rifle and a semiautomatic weapon, police Capt. Richard Spirlet said.

Spirlet confirmed three people were killed and two police officers who had been working security were among several people injured. It was not immediately clear if the gunman shot himself or was shot by police. The number of people injured and extent of the injuries were not released.

Outside the club, police cars riddled with bullet holes were parked in the street.

Club owner Tom Tsoumas said the two men killed in the attack were his nephew, Tory Marandos, 30, who was managing the club, and a security guard, Bobby Carreiro.

"We had told this young man not to come near the club," Tsoumas said.

Carreiro had told the man: "'This isn't the place for you. She doesn't want to see you. It's only going to cause problems."' he said.

"He went away, but he evidently came in last night," Tsoumas said.

Medeiros was familiar with the layout of the club because he had recently installed the security system, Tsoumas said.

Mayor Scott Lang initially said the shooter died of a self-inflicted wound; though police said there was an exchange of gunfire with officers and would not confirm the shooter killed himself.

"It looks like someone who clearly was not in his right state of mind," Lang told WBZ.

Cab driver Nick Santiago had been outside the club early Tuesday when he saw two women pulling a bloodied man out the front door, he said. He said a man wearing a black suit and bulletproof vest was holding a gun to the women as he propped open the door for them.

"I saw two girls screaming, telling the guy who had the gun not to shoot them," Santiago said. "Obviously, the gunman saw me and told me to get the hell out of there before I get shot."

As he drove away, Santiago said he saw police officers approaching, then heard gunshots. He stopped at a gas station nearby and two women who fled the club ran to his cab.

Santiago said the women were strippers and told him the shooter was a frequent customer who had been denied entry to the club.

Freetown Police Chief Carlton Abbott said Medeiros was issued a weapons license in 2005 that permitted him to buy assault-style military rifles. He was first issued a gun permit in 1991 after he told police he needed a weapon for protection because he carried large sums of money as a salesman, Abbott said.

A police background check, conducted prior to the 2005 licensing, showed that Medeiros had not been convicted of a felony, violent crime or had any restraining orders taken against him, Abbott said.

New Bedford, an historic whaling town of nearly 100,000 residents in southern Massachusetts, was the site of another bar shooting in February when an 18-year-old armed with a hatchet and gun seriously injured three men in a gay bar. That attacker fled and later killed two people in Arkansas before fatally shooting himself.

In October, a 21-year-old man was charged with attempted murder for allegedly trying to run down two police officers outside the Foxy Lady after an altercation in the club.