PASADENA, Md. (WJZ) — The fast-thinking of some officers from the Anne Arundel County Police Department is being credited with helping prevent a potentially serious incident.

Officers were called just before 6 p.m. Monday night to the Walmart on Ritchie Highway in Pasadena for reports of an elderly man inside of his car, sobbing and appearing to be in distress.

READ MORE: Stimulus Check Update: Are Relief Payments Bad For The Economy?

“Upon arrival, I went to the driver’s side window,” Officer McIntosh, of the Anne Arundel County Police Department, said. “I saw the man was crying, shaking and he was kind of just staring off into space straight ahead.”

“He attempted to unlock the door for us, couldn’t, still shaking, kind of seemed like he was weak physically,” Officer McIntosh added.

As officers tried to get the man’s attention, he suddenly accelerated a short distance. To prevent him from doing it again, officers used their vehicles to box in the man’s car.

“The main priority was protecting him and everyone else,” Officer Ristaino, of the Anne Arundel County Police Department, said. “So when I saw him take off, I knew that we had to try to get him to slow down and come to a stop.”

READ MORE: Adult Entertainment Resumes In Baltimore Friday Afternoon After City Agrees To Lift COVID Restriction

“At which point we ran to our cars and I was able to get in front of him,” Officer McIntosh said.

Officers eventually used a kit to open the man’s door. He was taken to an area hospital for treatment of the medical emergency that led to the incident.

“I think it’s a win for both the community and the police department,” Anne Arundel County Police Sgt. Kam Cooke said.

Fortunately, no one was hurt.

“People could have been seriously hurt, even killed in this situation,” Officer McIntosh said. “The parking lot was pretty packed.”

MORE NEWS: 'We Cannot Accept This': Teens Shot In Baltimore Thursday Still In Hospital, One In Grave Condition; Police Following Leads

Police say, after evaluation, it was determined the man was showing signs of a medical emergency.