Anaheim police shot and killed a man during a freeway gun battle linked to an earlier shooting that left an officer wounded, authorities said.

A woman motorist also was injured early Monday in the second shooting.

Officers tried to pull the man over shortly after midnight as he headed east on Highway 91, Sgt. Tim Schmidt said.

The man drove into heavy traffic near Brookhurst Street in Anaheim, striking several vehicles before getting out of his car with a gun. The man exchanged gunfire with at least two officers and was declared dead at the scene, Schmidt said.

Hours after the incident, investigators still were working determine whether the female driver was shot by police or the gunman. She was taken to the hospital with superficial wounds, Schmidt said.

All eastbound lanes of the freeway are expected to remain closed at Brookhurst until noon for the investigation.

The initial shooting took place Sunday when an officer investigating a report of a man exposing himself to children at a motel near Disneyland was shot in the leg by the man as he fled in a car.

The officer was not badly hurt, said police Sgt. Rick Martinez.

Two officers had arrived at the motel shortly before 8 a.m. after complaints that a man in one of the rooms was exposing himself to children and adults.

"They made contact with a guy believed to be the individual," Martinez said. "He was in the parking lot getting in a small compact-type vehicle."

Martinez said shots rang out as the man, in his 40s, drove off.