To neighbors, the top-floor apartment was not unlike the others in the Villages at Montpelier. They assumed that someone lived behind the door marked 4D, although no one could say for certain who it was. Last weekend, one neighbor said, there seemed to be a party inside.

Police say the Laurel area apartment was not a home but the site of a “well-organized gambling operation” that ran illegal poker games.

When three masked men tried to rob the operation late Tuesday night, it became the scene of a homicide.

Police said James T. Cornell, 43, of Ellicott City was inside the apartment when the men came to the door about 11:45 p.m. They knocked, someone cracked the door and the men “forced their way in,” fatally shooting Cornell, said Julie Parker, a Prince George’s County police spokeswoman.

The men “went to the apartment specifically with the intention of robbing someone,” Parker said.

Neighbors said they heard a loud bang, then heard people running down the stairs and through the halls of the three-story building. Soon, police were swarming the sprawling apartment complex, which is off South Laurel Drive.

On Wednesday afternoon, evidence tape still covered the apartment’s door.

One neighbor said he had complained to the apartment’s management company that the building’s exterior door — which was shut and locked Wednesday — occasionally was propped open. Another neighbor said she had heard what sounded like a loud party in apartment 4D last weekend.

But those neighbors and others said they did not know, and never would have guessed, that the apartment housed a gambling operation.

“I had no clue,” said one neighbor, who spoke on the condition of anonymity to protect his privacy.

Said another woman, who spoke on the condition of anonymity to protect her privacy: “It’s shocking, but I’m still covered by the blood of Jesus, so I’m okay.”

Parker said homicide detectives were investigating whether Cornell had a role in either organizing or participating in the gambling, but she said he would have known it was occurring in the apartment. She said people were gambling immediately before the shooting, and it appeared the apartment was not used as a residence but “was dedicated to illegal gambling.”

Law enforcement officials, speaking on the condition of anonymity because they were not authorized to discuss the details of the investigation, said that the apartment was used to play poker and that detectives had not found evidence of any slot machines or table games.

Officials said they were investigating the poker operation but had announced no suspects or arrests in that case.

Angela Bonsu, the Villages at Montpelier’s property manager, said that Cornell was not the leaseholder for the apartment and that she could not disclose who was. She said she was stunned to hear both of the shooting and that the apartment had housed a gambling operation.

“We’re finding out the same time everyone else is,” Bonsu said. “I’m still shocked.”

Bonsu said apartment officials had sent a letter to residents alerting them to what had happened.

Reached by phone, Cornell’s brother and sister separately declined to comment, saying they were still seeking details about the incident.

Parker said police are searching for the three men thought to be responsible for the crime.

Jennifer Jenkins contributed to this report.