The handgun was a ­.380-caliber semiautomatic. The vehicle was a 1999 Lincoln. The alleged shooter, suspected of firing indiscriminately at people and buildings as he roamed by car through a swath of suburban Maryland in the past week, was a 35-year-old former prison guard named Hong Young, now in police custody.

Still to be answered: Why?

“We have not gotten into the mind of the suspect,” Anne Arundel County police spokesman T.J. Smith said in announcing Young’s arrest Wednesday. Young is charged with shooting at a motorist Feb. 24 from the driver’s seat of his Lincoln Town Car and is suspected of opening fire Tuesday on two men in a tree-service truck, police said.

They said he also is suspected of firing shots into a Wal-Mart store and an AMC movie theater in the wee hours of Monday, when both businesses were closed, and shooting at a National Security Agency building Tuesday evening.

No one was seriously injured in the incidents.

Hong Young. (Courtesy of Anne Arundel County Police Department)

“This guy apparently has some . . . issue going on that our detectives continue to follow up on to see exactly what’s going on with him,” said Smith, who was joined by a bevy of law enforcement officials at a news conference at Anne Arundel police headquarters.

Young, who authorities said was a Maryland correctional officer from January 2012 until he quit in May last year, was driving the blue Lincoln late Tuesday night when Anne Arundel police, on the lookout for the Town Car, stopped and arrested him “without incident,” Smith said. He said officers found a Bersa .380 pistol in the vehicle.

The handgun, legally registered to Young, has been linked by ballistics tests to four of the shootings, Smith said, and the Lincoln has been tied to the other shooting by video surveillance footage.

In a search of Young’s Colonial-style brick home in Beltsville, Prince George’s County police said, they confiscated 10 more firearms — pistols and long guns — as well as hundreds of rounds of ammunition and a crossbow.

“We’re all standing up here fortunate that we’re not having to go to anybody’s house and give a death notification,” Smith said. “He’s off the street.”

Prince George’s court records show that Young filed papers Sept. 24 seeking a divorce from his estranged wife, Bunnary Ngo. No reason was given for the divorce action, and the case was dismissed Monday because Young did not follow up on his request. He and Ngo were married in a civil ceremony in 2007, according to court records.

In a phone interview Wednesday with the Baltimore Sun, Ngo said she has been living in California for several months while Young remained in Beltsville with his mother, according to the newspaper. Ngo said she had not spoken with Young recently.

“I am going to divorce him,” she said.

She said she spoke by phone several days ago with Young’s mother, who was worried because she did not know his whereabouts.

“Everybody was trying to reach him,” Ngo told the Sun.

Police searched Young’s home Wednesday, in the 4900 block of Daisey Creek Terrace, but no one answered when a reporter knocked at the front door.

A neighbor, not acquainted with Young, said he noticed odd behavior by a man in his 30s who lived in the house. “He used to pace up and down the street at all hours of the night,” said the neighbor, speaking on the condition of anonymity for privacy reasons. The man was “in another zone or something,” the neighbor said.

“You never know what’s in someone’s mind.”

In announcing Young’s arrest, police Wednesday repeatedly harked back to the October 2002 sniper attacks in the Washington area, voicing relief that no one was severely hurt in the recent shooting spree. The snipers, John Allen Muhammad, who was executed in 2009, and Lee Boyd Malvo, imprisoned for life without parole, terrorized the region for three weeks, shooting 13 people, 10 fatally.

The previous week’s shootings more closely echoed the crimes of Yonathan Melaku, an ex-Marine who roamed Northern Virginia in 2010 firing shots at the Pentagon and other military facilities, including recruiting stations. After pleading guilty to three charges, Melaku was sentenced to 25 years in prison.

As for Young, “We don’t have any concern or belief that this is related to any kind of terrorism,” Smith said.

The first attack connected by police to Young occurred about 7:30 a.m. Feb. 24, when someone in a car fired shots at a 61-year-old motorist as he pulled out of a Costco gas station near the Arundel Mills mall in Anne Arundel.

“Our detectives were able to recover evidence from that scene, including surveillance video,” Smith said. After the video, showing the suspect’s car, was made public, “tips were received, but unfortunately, none of the tips led to an identification.”

In that attack, Young was charged with first- and second-degree assault and using a handgun in a violent crime.

Shortly before 3 a.m. Monday, someone fired shots into the Wal-Mart Supercenter in Laurel, 10 miles south of the Costco gas station.

“At that time, we had no real witnesses,” Smith said. “No victims. And we once again did not have a suspect. Later, surveillance video indicated that the same style vehicle was involved in that shooting, as well. At that point, the coordination efforts started. We knew something was going on and that it was a little bit unusual.”

He said the next shooting was reported two hours later — in Howard County, 14 miles northwest of the Wal-Mart — after a cleaning crew at the AMC Theatre at the Mall in Columbia heard gunshots. The bullets were fired at the theater’s windows.

Then about 2:40 p.m. Tuesday, “in the midst of an ice storm,” bullets pierced the windshield of a Nelson Tree Specialist truck traveling on the Intercounty Connector in Prince George’s, near Old Gunpowder Road. One of the men was bruised by a bullet fragment, police said, and the other suffered cuts from flying glass.

The highway shooting, in Prince George’s, happened 15 miles south of the movie theater.

“As soon as that happened, our detectives responded down there” from Anne Arundel, “and the coordination began once again,” Smith said. “While they were still on scene investigating that, the incident occurred at the NSA building, near National Business Parkway.”

The parkway, in Anne Arundel, is 12 miles northeast of where the highway shooting occurred. The NSA building is along a stretch of road just east of the Baltimore-Washington Parkway, separate from the agency’s Fort Meade headquarters. “It wasn’t the main NSA building that we’re used to seeing in movies and all,” Smith said.

At the news conference, Maryland Secretary of Public Safety and Correctional Services Stephen Moyer said that Young worked as a correctional officer at a medium-security facility in Jessup until he resigned last spring. Moyer said that there was nothing unusual about Young’s record as an employee.

Young was arrested without incident and has been cooperating with detectives interviewing him, authorities said at the news conference. He is being held at a hospital. Police declined to say why Young needed medical treatment.

Hours after the final shooting Tuesday, Anne Arundel police stopped the Lincoln near the Arundel Mills Costco — the site of the first shooting — and put Young in handcuffs.

Peter Hermann, Dana Hedgpeth, Julie Zauzmer and Jennifer Jenkins contributed to this report.