Montgomery County Assistant Russ Hamill described the attempted carjackings at Md. shopping centers on May 6, and detailed how two of the victims "selflessly and heroically" saved a woman. She and one man were injured, while the other died. Suspect Eulalio Tordil is in custody. (WUSA9)

A frantic 22 hours of mayhem at a school, a mall and a grocery store jolted two counties as it left three dead and three wounded before a suspect was captured Friday afternoon in a Maryland parking lot near the scene of the final killing.

The arrest of Eulalio “Leo” Tordil, a 62-year-old federal law enforcement officer, followed a manhunt that forced Montgomery County schools, government buildings and retail establishments to lock down. Just before 3 p.m., police cruisers rammed Tordil’s silver Hyundai Elantra as it sat parked outside a strip mall. Officers drew their guns and shouted for him to surrender — just one day after he had allegedly gunned down his wife within view of her daughter.

Although authorities said he had planned to die in a “suicide by cop,” Tordil soon emerged from the car with his hands up.

“He gave up peacefully,” said Theresa Doyle, 55, who witnessed the arrest from her car near a Dunkin’ Donuts. “I am still shaking. This could have been so much worse.”

The sporadic shootings sparked a deep sense of foreboding that echoed what the same neighborhood suffered through during the Beltway sniper rampage that took 10 lives in 2002.

“It was an irony that was not lost on me,” Montgomery County State’s Attorney John McCarthy said.

The snipers, Lee Boyd Malvo and John Allen Muhammad, had even eaten lunch at the same Boston Market where a witness was told by employees that Tordil quietly ate his lunch — a salad and a glass of water — near a window facing his car.

Prince George’s County ­officials charged Tordil with first-degree murder and related ­charges in his wife’s killing and other counts in the shooting at the school. Other than his wife, none of the victims has yet been publicly identified. In a statement late Friday, Montgomery police said Tordil was “currently being interviewed by detectives,” and they indicated that he had not been charged in that jurisdiction. ­

The killing began Thursday afternoon, investigators say, when Tordil approached his estranged wife, Gladys Tordil, as she waited in a parking lot at High Point High School in Beltsville to pick up her two daughters.

When a man tried to intervene, authorities said, Tordil shot him in the shoulder. They say Tordil then pointed his weapon at his wife’s SUV, firing repeatedly until she died.

At that moment, her 16-year-old daughter was walking out of a nearby band room. Hearing the shots, another student pulled her back inside and ran to alert others.

“That’s when the whole school panicked,” said 17-year-old Chris Mejia, High Point’s senior class president.

In March, at the behest of his wife, a civil court issued a protective order against Tordil for alleged abuse, according to court documents. In the filing, she claimed that her husband, a black belt in the martial-art form of aikido, subjected her children to “intense-military-like discipline” and that he struck her in 2010.

“He threatened to harm me,” she said, “if I leave him.”

As a result of the order, his employer, the Federal Protective Service, put him on administrative duties and stripped him of his gun and badge. Authorities say they also confiscated a stockpile of his personal weapons. His wife indicated in the protective order that he owned .40-caliber and .45-caliber handguns, an M4 military carbine, a revolver and a “hunting gun.”

Under “favorite quotes” on Tordil’s Facebook page, it lists a single misspelled line: “You can ran, but you can’t hide.”

Authorities tried to begin tracking Tordil immediately after the shooting at High Point.

They had little to work with and were contending with a suspect whose career in law enforcement made him even harder to pursue, said Prince George’s County Police Chief Henry P. Stawinski III.

Tordil had turned off his phone 20 minutes before the first shooting and never turned it back on. Video of the shooting was grainy and showed only a silver sedan, but police quickly learned that he had leased the Elantra and knew the Pennsylvania license plate number.

That provided them the only firm nugget of information to track their suspect.

Police didn’t release details about the car to the public Thursday night, fearing Tordil might catch on and abandon it, Stawin­ski said. But they did inform other law enforcement officers.

“He is a police officer, and he would be doing countersurveillance on us and watching the media,” the chief said. “If he knew we knew that was his car, he would get rid of the car.”

More than 100 undercover officers, homicide detectives and special patrol teams from Prince George’s alone fanned throughout the region. The car’s license tag was spotted around midnight, but Tordil eluded authorities throughout the night.

The violence on Friday began about 11:15 a.m., police said, when Tordil fatally shot one man and wounded another man and a woman in the parking lot of Westfield Montgomery Mall. Police said they think that Tordil shot two of the three as they rushed to help the first victim. As of late Friday night, they said the wounded man was in critical condition and the woman in stable condition with non-life-threatining injuries.

Jose Mauricio Gomez, 54, was eating lunch in his pickup when he heard six to eight shots. When a police officer pulled up next to him, Gomez realized that the crime scene was nearby.

Neither man spotted the shooter, but they did see one victim, a woman with a shoulder wound.

The officer asked the woman, who appeared to be in her 30s, whether she could stand.

“That’s when blood shot out of the hole in her shoulder and he sat her back down,” Gomez said.

The only thing she talked about, he recalled, was how upset her husband was going to be.

While at that scene, officers received a 911 call from the Giant grocery store in Aspen Hill, nine miles away, where a woman had been shot to death in her car.

Soon after, a plainclothes officer spotted Tordil’s car parked across the street from the grocery store, according to McCarthy. Investigators soon realized Tordil was still nearby after showing wanted fliers at area businesses.

Tordil, McCarthy said, first got a cup of coffee at Dunkin’ Donuts, then went to Michaels craft store to “browse around” before heading to Boston Market, where he quietly ate lunch near a window.

As many as 100 officers kept up surveillance but resisted closing in to avoid a bloody firefight in a bustling shopping area.

“We needed to make sure the public was safe when we took him into custody,” said Montgomery County Police Chief J. Thomas Manger. “Our fear was he was armed, since he already shot four people today.”

When Tordil returned to his car, officers swarmed.

He was soon led away in handcuffs, with either rain or sweat soaked through his jeans and light-brown polo.

“The judgments made today by police saved a lot of lives,” McCarthy said. “This went down exactly as planned.”

Authorities have no evidence that Tordil knew the people he has been accused of attacking on Friday, leaving investigators to sort through his motivation.

It also remains unclear what led him to allegedly kill his wife, a mother of two teen girls who supported her children and family members in the Philippines.

Gladys Tordil, who taught chemistry at Parkdale High, should have been honored this week — both for National Teacher Appreciation Week and Mother’s Day — and not killed in front of her daughter, said Mejia, the student body president.

“My niece had her as a teacher last year. She said she was a great person,” he said. “She was always happy, always singing, always dancing.”

On the door of her classroom, more than 100 hand-scrawled sticky notes captured what she had meant to those left behind, a mosaic of memories on squares of pink, blue, green and yellow.

Read one: “To the reason I’m pursuing Chemistry.” Another: “Thank you Mrs. Tordil! Rest in Peace!” And another: “We will forever love you.”

Ann E. Marimow, Donna St. George, Peter Hermann, Arelis R. Hernández, Justin Wm. Moyer, Martin Weil, Michael E. Ruane, Keith L. Alexander, Dan Morse, Victoria St. Martin, Moriah Balingit, Dana Hedgpeth and Hamil R. Harris contributed to this report.