UPPER MACUNGIE TOWNSHIP, Pa. (CBS) — The gun used by the gunman who went on a shooting spree outside a Wawa in Upper Macungie Township on Wednesday, killing one person and injuring another before he died by suicide, was purchased legally, authorities in Lehigh County said Thursday.

Lehigh County District Attorney Jim Martin said 45-year-old Za Uk Lian, the suspected shooter, purchased the Smith & Wesson M&P Shield .40 caliber semi-automatic handgun on Jan. 30 in Lehigh County.

READ MORE: 2 People Killed In Fast-Moving Rowhome Fire In Wilmington

Martin said Lian applied for a concealed carry permit on Feb. 5 and was approved on March 21.

The incident began about four miles away from a Wawa in the westbound lanes of Route 22 between Route 309 and Cedar Crest Boulevard when a woman heard a loud bang while driving. Authorities said the woman did not realize her vehicle had been shot upon until she pulled into the Wawa and noticed a bullet hole in her vehicle. The woman was not injured, authorities said.

According to authorities, Lian pulled up to the same Wawa and shot a man inside a Jeep. He had surgery for his wound and is expected to be OK.

Investigators said the man and woman ending up at the Wawa was coincidental.

Lian, authorities said, then fired at a truck driver identified as 31-year-old Ramon Ramirez, who was pumping gas. Ramirez was rushed to the hospital, where he was pronounced dead.

“He was definitely a great father, always providing for his family,” Willy Holmes, a childhood friend of Ramirez, said. “My heart just breaks for the family, especially his kids.”

READ MORE: Police: Man Shot Multiple Times, Killed In North Philadelphia

Ramirez was a married father of three working for A. Duie Pyle trucking company.

The alleged shooter fled on foot, the district attorney said, and died by suicide about a quarter-mile away.

“We don’t have any motive. At this point, it appears that the three shootings that I have described are indiscriminate and unrelated,” Martin said.

The Lehigh County Coroner’s Office on Thursday ruled Ramirez’s death a homicide and Lian’s death a suicide.

Martin credited a Wawa employee with helping people take cover during the incident.

“There was an employee of Wawa who was taking out trash and heard the gunshots,” Martin said. “He ushered two prospective customers from the parking lot into the Wawa and he alerted the employees in the Wawa to shelter in place and he locked the doors. So, all credit to him.”

Wawa released the following statement: “At Wawa, the safety and security of our associates and customers is paramount. We are truly grateful for the actions of one of our associates who acted swiftly to protect customers and fellow associates. We are also thankful for the work of local law enforcement and are fully cooperating with them as they conduct their investigation. Right now, we are focused on the wellbeing of our store teams and defer all further questions regarding the incident to local law enforcement.”

MORE NEWS: Woman Shot, Killed In Kensington Home

The Wawa reopened on Thursday.