A policeman patrolling with three partners in an unmarked car was shot and wounded by a motorist early Saturday morning, and another officer and her husband were arrested in the attack.

Officer Jacqueline Melendez-Rivera was arrested on charges including hindering prosecution and tampering with evidence, while her husband, Jose Rivera, was to be charged with attempted murder, assault and other crimes, police said.

Earlier in the day, authorities said they did not believe the 37-year-old officer, a 13-year veteran, was present for the shooting.

The incident unfolded just after 4 a.m. in Brooklyn's Park Slope section and sparked a hail of gunfire that littered the street with spent shell casings.

A four-year member of the force, Andrew Suarez, was struck in the back by the initial shot, but is expected to make a full recovery.

The shooter and a passenger escaped. But Rivera and another man were later detained at the couple's home, about a block away.

Police said they later recovered a loaded 9mm handgun in a yard on the same block.

Investigators said the gunplay began when Suarez and three fellow plainclothes officers on a routine anti-crime watch pulled their car over to get a closer look at a vehicle driving behind them. That car then slowed alongside the officers.

Police Commissioner Raymond Kelly said the driver leaned across the body of a male passenger, shouted "You got a beef?" and fired a shot at Suarez, who was driving. The bullet traveled underneath his bulletproof vest, through his back and lodged in his neck. A second shot may have also been fired, Kelly said.

The three other police officers returned fire, blasting at least 13 shots before the car sped away.

The case took a surprising twist a short time later when police stopped a vehicle matching the description of the one involved in the shooting. At the time, the female police officer was behind the wheel, Kelly said.

Just what the officer was doing with the car, a mile and a half from the crime scene, was unclear, Kelly said before the arrests.

Police raided Melendez-Rivera's home and detained the men.

"We never want to jump to conclusions," Mayor Michael Bloomberg said in a news conference Saturday morning at the hospital where Suarez was being treated.

Suarez was appointed to the force in 2003 and is assigned to the 78th precinct.

Mayor Michael Bloomberg met with Suarez at the hospital and said he was in good spirits.

"We joked and we laughed," Bloomberg said. "We're just lucky this wasn't an awful lot worse."

Suarez was the first city police officer shot this year, and the third wounded by gunfire since October.

"Let us pray that it's the last," Bloomberg said.