Authorities said that two men in separate vehicles suffered life-threatening gunshot injuries. Ryan identified the alleged gunman as Tyler Brown, 46, of Boston.

Two law enforcement officials briefed on the investigation said Brown is the same man who fired several gunshots at Boston police officers in the South End in 2020.

On Monday, Brown was shot in the extremities after a State Police trooper and the civilian confronted him and opened fire, Ryan said during a press briefing at the city’s Police Department. Brown was being treated in the intensive care unit of a local hospital, she said.

Ryan’s office said Brown is expected to be charged with two counts of armed assault with intent to murder and firearms offenses.

Witnesses recalled the terrifying sound of gunfire in the middle of the afternoon near the campuses of Harvard University and the Massachusetts Institute of Technology. (Neither campus was affected)

“He pointed his, it looked like a machine gun, at my windshield,” said Adonna Simpson-Correia, who was driving her van-style school bus, with only a bus monitor on board. “We both got out and ran, and he kept shooting.”

Cars were detoured trying to cross the River Street Bridge amid a heavy police presence on Memorial Drive in Cambridge on Monday. Jessica Rinaldi/Globe Staff

Cambridge police were first alerted about 1:06 p.m. after Boston police reported that a man believed to be armed with a rifle and acting erratically was in Cambridge, Ryan said.

By the time troopers and Cambridge officers arrived near Memorial Drive, Ryan said, Brown was already shooting.

“That individual was already traveling down the middle of Memorial Drive,” Ryan said. “Cars were stopped in traffic. He was in the possession of that assault style rifle … and he was actively firing in an erratic fashion at various vehicles along the road.”

Authorities said a State Police cruiser responding to the scene was struck by gunfire.

Ryan said the responding trooper and the armed civilian — whom she identified only as a former Marine licensed to carry a firearm — moved toward the gunman as terrified drivers and pedestrians sought cover.

“People were jumping from their cars, scattering in various directions,” Ryan said. “Both that trooper and that civilian, rather than going in one direction, went towards the suspect with their weapons to try to end that situation.”

As investigators processed the scene, a rifle was seen on the ground between the road and the bike path along the Charles River.

“We know that that weapon had the capacity to have struck people on the other side of that river,” Ryan said. She said there is no evidence suggesting any connection between Brown, the victims, or anyone else in the area where the shooting occurred.

Brown is currently serving three years of probation after his release from state prison last year for the May 2020 shooting that involved four Boston police officers, court records show. The officers were not injured but they were evaluated at a hospital. Brown had been released from prison four months before the 2020 shooting.

Court records did not specify Brown’s exact date of release. The state Department of Correction did not immediately respond to a request for comment from the Globe on Monday.

Ryan credited the trooper and civilian with stopping the attack within minutes.

“This incident lasted minutes thanks to the actions of the trooper and that civilian,” she said.

Massachusetts State Police Colonel Geoffrey Noble praised the response by troopers and Cambridge police officers.

“The minute that the bullets stopped and the suspect was down … police officers immediately rendered aid,” Noble said.

Officers interviewed people sitting in a car on Memorial Drive. Jessica Rinaldi/Globe Staff

Cambridge Acting Police Commissioner Pauline Wells said officers “ran toward danger without hesitation.”

“Without their quick and selfless acts, today’s situation would have been a lot worse,” Wells said.

The violence broke out on a mild spring afternoon along one of Cambridge’s busiest corridors, where joggers, cyclists, students, and residents typically fill the sidewalks and paths running beside the Charles River.

Witnesses described a terrifying scene as gunfire echoed across Memorial Drive and motorists abandoned vehicles in panic.

Todd Czubek, a deaf studies lecturer at Boston University, said he was leaving work and driving down Memorial Drive when he heard the gunshots.

“I was like, ‘What the heck? I’m like, there’s a guy with a machine gun shooting,’” Czubek said.

He said he saw the man emerge from a parking lot wielding what appeared to be an automatic weapon and “shooting randomly.”

Joseph Minino Rodriguez said he watched the shooting unfold from his apartment balcony overlooking Memorial Drive. He said the gunman fired at least five shots before appearing to have his weapon jam.

“He didn’t give a [expletive],” Rodriguez said. “He didn’t care.”

Rodriguez said the man then fired toward a truck before moving onto a nearby street, where he exchanged gunfire with police.

“Once he got in that gunfight, that’s when he got dropped,“ Rodriguez said.

Rodriguez said authorities rushed in to provide medical aid after the suspect was shot.

“He was moving,” he said.

Lisa Schill, Simpson-Correia’s bus monitor, said she first tried to hide inside the vehicle before fleeing on foot.

“They told me to run for cover but he was still popping,” Schill said. “So I ran, and fell, and then ran down the street.”

Their abandoned van remained behind police tape hours later among dozens of other vehicles stranded at the sprawling crime scene.

Shannon Young, 34, said he and another driver, Brandon Mansolf, fled on foot after bullets struck their vehicles.

“He let off probably 10 shots within 15 seconds,” Young said. “As I got to about this tree, state troopers were coming in on different sides, like seven people on foot coming in.”

Young estimated “easily 100″ people fled the area as traffic snarled and drivers attempted frantic U-turns to escape the gunfire.

Video footage provided by Mansolf showed law enforcement providing aid to a person laying motionless on the ground.

Witnesses credited law enforcement with responding quickly. Czubek said he abandoned his car in the roadway while dialing 911.

“Thankfully the police responded so quickly and professionally,” he said. “They did a great job.”

By midafternoon, a large section of Memorial Drive near River Street remained sealed off with yellow police tape as more than a dozen marked and unmarked State Police cruisers crowded the area with lights flashing. Multiple helicopters hovered.

Investigators appeared focused on a small commercial plaza at 808 Memorial Drive that includes a Dunkin’ store. Yellow and green evidence markers dotted the pavement outside.

Two gas stations along Memorial Drive near the scene were also roped off with yellow police tape, the same area where, during the manhunt following the 2013 Boston Marathon bombing, the Marathon bombers stopped for gas after a carjacking and their kidnapping victim escaped by running to the other gas station for help.

The disruption Monday rippled through the busy university area as pedestrians and drivers encountered roadblocks and confusion while police directed traffic away from the scene.

State Police remained on the scene until late Monday night. A hazmat team, wearing white protective suits and gloves, picked up glass and other debris and placed it into evidence bags. Several tow trucks were removing vehicles from the scene, and police were taking down crime scene tape just before 10 p.m.

State Police said Memorial Drive was fully reopened to traffic shortly before 10:30 p.m.

Ryan said investigators expect to spend days reviewing witness statements, video, and ballistics evidence from the scene.

“We have hundreds of witnesses, literally, that will be in the process of being interviewed over the next several days,” Ryan said.

Kathy McCabe, Tonya Alanez, and John R. Ellement of the Globe staff and Globe correspondent Chloe Pisani contributed to this report.

Travis Andersen can be reached at travis.andersen@globe.com. Bryan Hecht can be reached at bryan.hecht@globe.com. Follow him on Instagram @bhechtjournalism. Nick Stoico can be reached at nick.stoico@globe.com. Jessica Rinaldi can be reached at jessica.rinaldi@globe.com.