The suburban New York grocery store worker accused of fatally shooting one of his managers and wounding several others allegedly had a history of harassing and acting aggressively toward co-workers, and had a meeting with his supervisor about switching to a different job location less than an hour before he opened fire, officials said Wednesday.

Gabriel DeWitt Wilson, 31, appeared before a Long Island judge on Wednesday morning to face one count of murder and four counts of attempted murder, Nassau County District Attorney Madeline Singas and police officers said during a subsequent press conference. He was ordered held without bail.

Shortly after 11:15 a.m. Tuesday, Wilson went into the second-floor management office of a West Hempstead Stop & Shop and fired his gun seven times and five different people inside Nassau County Police Det. Lt. Stephen Fitzpatrick said Wednesday. Three people, ages 26, 49 and 50 were wounded. The 49-year-old, a man identified by police as Ray Wishropp, could not be saved.

Gabriel DeWitt Wilson

Gabriel DeWitt Wilson (Nassau County PD)

"This is his place of employment. He is a shopping cart gatherer there," Fitzpatrick said.

Wilson allegedly had an "uneventful" meeting with his one of his supervisors, the 50-year-old man, around 10:30 a.m. Tuesday, when he asked them about switching to a different store location.

"Yesterday he went to speak to that manager of West Hempstead to ask what the process would be because he wanted to transfer," Fitzpatrick said.

NEW YORK SHOOTING AT SUPERMARKET LEAVES 1 DEAD, 2 WOUNDED

Earlier in the press conference, Fitzpatrick described the meeting as "not confrontational" and lasting only one to two minutes.

"He left the building without and violence or anything else being said," he continued. "Forty minutes later, he returned to the building, and you know the rest."

Police said they have not yet recovered the .380-caliber semiautomatic handgun they suspect he used in the shooting.

Fitzpatrick called Wilson a "troubled employee" who had been accused of making "unwanted advances toward females at work." Colleagues also alleged "that he was having disputes with other workers and threatening them and was brought to the management office on several times," Fitzpatrick said.

GEORGIA FUGITIVE CAPTURED IN ALABAMA AFTER 3 YEARS ON THE RUN FOR MURDER OF EX-GIRLFRIEND

Police said Wilson fled from the store on foot after the shooting and was taken into custody hours later at an apartment building in Hempstead, New York. He tried to "make a run" through the building’s first floor but was stopped by Hempstead Police officers who had barricaded the doors.

"He was trapped like a mouse in a trap," Nassau County Police Commissioner Patrick Ryder said.

Emergency service personnel work at the scene of a shooting at a Stop & Shop supermarket, Tuesday, April 20, 2021, in West Hempstead, N.Y. A gunman shot three workers inside a manager's office at a Long Island grocery store Tuesday police said. (AP Photo/Mary Altaffer)

Emergency service personnel work at the scene of a shooting at a Stop & Shop supermarket, Tuesday, April 20, 2021, in West Hempstead, N.Y. A gunman shot three workers inside a manager's office at a Long Island grocery store Tuesday police said. (AP Photo/Mary Altaffer)

Ryder said Wilson’s criminal history dates back to 2006 and includes assault, attempt to distribute narcotics and an attempted murder charge stemming from a 2014 gun battle in Baltimore, which resulted in Wilson being shot in the head, Ryder said. At the time, Wilson was also charged with criminal possession of a firearm.

Ryder added that local politicians, clergy members and community members came forward with tips and offers for assistance during the search for Wilson.

CLICK HERE TO GET THE FOX NEWS APP

"The men and women in law enforcement have [been] challenged every single day over the last year and a half," he said. "In Nassau County, what you saw was the cooperation between community and police. It was the cooperation between law enforcement agencies in Nassau County, the 18 villages and two cities, all of us working together."

Wilson is due back in court on Friday and faces 25 years to life if convicted on the top charges.