A scandal-scarred former narcotics cop who had agreed to testify against another indicted officer fatally shot his girlfriend in Brooklyn Sunday, police sources said.

The ex-officer was taken in to custody by police early Monday morning at the 120 Precinct in Staten Island.

Jerry Bowens, 43, shot 28-year-old Catherine Donofrio in the head in a Greenpoint apartment belonging to one of her friends at 4:30 p.m., police said.

She was pronounced dead a short time later at Bellevue Hospital.

Bowens also shot the friend, Melissa Simmons, cops said. She suffered a bullet wound to her forearm and a graze wound on her head.

The officer was arrested in January 2008 in a police sting by the Brooklyn South Narcotics squad for allegedly stealing drugs and money from an undercover cop posing as a dealer. He was stripped of his gun at the time.

He’d been ratted out by a female drug informant, who claimed that he had sex with her, sources have said.

Bowens called the NYPD Sunday from a Jersey motel. When cops arrived, they found bloody rags, but no sign of the officer, a source told The Post.

Police last night searched a building in Bensonhurst where Bowens and her parents lived in separate apartments.

Donofrio’s father said, “All I’m worried about is them going after the guy who did it.”

Annie Turchiano, Donofrio’s godmother, said the victim had moved into the building to help take care of her legally blind parents and her 99-year-old grandmother.

“She’s a dedicated daughter, a wonderful, outgoing girl who took care of her family,” Turchiano said.

“Her family is in pieces, Her mother will never be the same.”

Neighbors said the father had been worried about his daughter.

“He said that he knew that [Bowens] was a bad guy,” said Raymond Nieves, who lives in the building. “He said he told her a thousand times . . . to get out of [the relationship].”

Nieves said he hadn’t seen the couple together for three days.

“It felt like something was wrong,” he said.

Bowens was busted in a far-reaching drug probe that resulted in the arrests of four other cops.

More than a dozen officers were assigned to desk duty, and several commanders were reassigned.

Bowens was set to testify against Sgt. Michael Arenella, who was arrested with him, sources said.