A former cop has agreed to accept $340,000 to settle her explosive suit against the city and the male supervisor who beat her on a Manhattan street, sources told The Post.

Sharon Gandarilla, 37, said the NYPD ignored her complaints and did nothing to stop abuse from ex-lover Capt. Alberto Sanchez — instead punishing her by falsely charging her with fudging her time sheets.

The two married cops began their illicit affair in 2004. In 2006, he pummeled and threatened to kill her at a West Village intersection after they stormed out of a party.

He was convicted of misdemeanor assault and spent 40 days at Rikers Island.