By Michael Rosenfield, WBZ-TV

ROCKLAND (CBS) – A woman from Plymouth is lucky to be alive after plowing her car into a tree.

READ MORE: Marcus Smart questionable for Celtics-Heat Game 1 with foot injury

It happened Monday morning on Route 3 in Rockland.

Massachusetts State Police identify the woman as Amy Stanley.

WBZ NewsRadio 1030’s Karen Twomey reports

It is unclear what caused Stanley’s Pontiac Grand Prix to leave the southbound lanes and end up in a tree in the median.

Several bystanders, including an off-duty fire captain, raced to free the woman who was trapped behind the wheel.

“Her legs were pinned between the dashboard and the seat,” said Capt. Eddie McGarry, who was on his way to work at the Chelsea Fire Department. McGarry was in the northbound lanes of Route 3 when he saw smoke coming from the woman’s car. He grabbed his gear, hopped the guardrail and joined the frantic rescue. Several witnesses were already trying to help.

READ MORE: More hot weather ahead: Boston area could hit 90+ on Saturday

McGarry says they were able to pull the woman through the driver’s side window as smoke and flames were entering the passenger compartment from the engine.

“God was good, we were very, very lucky to get her out,” said McGarry.

McGarry, who was treated for smoke inhalation and some minor cuts, says as soon as the victim was out of the car the vehicle was fully engulfed.

He says the credit for the rescue belongs to the others who pitched in.

“The bystanders were just terrific, they stayed right with me,” said McGarry. “There’s no way I could have gotten her out by myself, it was a team effort.”

The woman was semi-conscious when she was pulled from the car, according to McGarry.

MORE NEWS: 'Unfortunate that it came to this,' Brookline school teachers go on strike

She was taken to a Boston hospital with serious injuries and is in intensive care.