A Hamptons doctor at the “gruesome” scene of a Southampton collision of two SUVs was credited by police Thursday with providing crucial first aid to a woman critically injured in the head-on crash.

The victim, Charlotte Meyer, 20, of Germany, was one of two women hospitalized Wednesday after the driver of a westbound Lexus SUV crossed into the eastbound lane on a rural stretch of Hill Street and slammed into their 2015 Audi Q5, Suffolk police said.

Shortly after the 3:19 p.m. crash, Dr. Babak Maharlouei, 45, an anesthesiologist, happened on the scene as he drove from home to run errands in Southampton Village. He said other drivers jumped out to help, but there were no police officers or other rescue crews in sight.

Maharlouei climbed out of his car and quickly assessed a frightening scene with the clock ticking.

The force of the crash had caved in one side of the Lexus. The driver, identified by police as Derek Alegria, 27, also of Southampton, sat inside, conscious but with blood from one of his hands. Maharlouei turned and saw the Audi — its airbags deployed and doors gone after the SUV careened into a tree. About 30 yards away, a woman thrown from the Audi lay on a patch of grass.

“It had spun out,” Maharlouei said of the Audi. “The doors were blown out and I saw the woman who was ejected.”

advertisement | advertise on newsday

When he glanced back to the Audi, he saw Meyer, motionless and slumped over in the SUV’s front passenger seat. He quickly approached the vehicle and saw she had a large laceration on her head. Meyer was unconscious and barely breathing, the doctor said. Her pupils were fixed and dilated.

“She had a weak pulse and her breathing was shallow . . . by this time the police and firefighters got there” along with emergency medical personnel, Maharlouei said. “I stabilized her head and neck and asked the officers to grab her by her legs and torso so as not to move her head.”

Maharlouei, a partner in East End Anesthesiologists LLC which operates out of Southampton Hospital, said his training at a Level 1 trauma center at Manhattan’s Bellevue Hospital Center kicked in.

“An anesthesiologist’s job is to take you through the most critical part of an operation,” he said. “Basically resuscitation is what we do . . . We’re critical care doctors.”

Her head wound and unconscious state told him she might have had a brain injury and accompanying swelling.

His next thought: keeping her alive through hyperventilation — inserting a tube borrowed from responding paramedics into her trachea to decrease brain-swelling levels of carbon dioxide.

Because of swelling, Maharlouei said, “there’s not much place for the brain to go but down to the spine and that puts pressure on the brain stem and that’s what kills you.”

Meyer and the other injured woman, Luisa S. Keszler, 26, of Southampton, were eventually airlifted from a nearby site to Stony Brook University Hospital, police said. Meyer was in critical condition Thursday and Keszler was stable after emergency surgery, police said. Alegria was in stable condition at Stony Brook Thursday, police said.

Maharlouei’s rapid response gave Meyer a chance to live that she might not have had without the doctor’s care, police said.

“He was on the scene pretty quickly . . . He gave her a good opportunity to survive,” said Det. Sgt. Herman Lamison, commanding officer of criminal investigations.

advertisement | advertise on newsday

With John Valenti