A 47-year-old convicted sex offender from Brooklyn has been accused of pretending to be a police officer to coerce a woman into having sex with him, the NYPD says.

Walter Barnes is charged with rape, aggravated sexual abuse and impersonating a police officer after police say a woman told investigators a man pretending to be an officer picked her up in Brooklyn and threatened to arrest her unless she performed sex acts on Oct. 2.

The woman said she was walking at Gates Avenue and Broadway in Bushwick to buy cigarettes that morning when a 2010 Lexus sedan with Georgia plates pulled up. The man inside the car talked to her, asked where was going and offered to drive her to a store.

Once the woman was inside the car, investigators say the man allegedly began speaking police jargon into a handheld radio and pointed at a marked NYPD van that went by and said that he knew the officers in the vehicle. He never showed a weapon or a police shield.

The man then allegedly told the woman that she would be arrested if she didn’t perform a sex act on him, police say. He drove to Aberdeen Street and Bushwick Avenue and again threatened to arrest her, so the woman complied with his demand. Police say she was then sexually assaulted.

Police say the suspect then drove the woman to Sherlock and Herkimer streets and again allegedly threatened to arrest her. She again began to perform a sex act on the man but attacked the suspect when he tried to undress her and force himself on her, authorities said. The woman was able to get out of the car and ran into a building, where she asked for help.

Barnes, a level three sex offender who has been arrested 16 times since 1984, was arrested Wednesday. Information on an attorney for him wasn't available.

A Bushwick resident wondered how a serial criminal could have an opportunity to attack again.

"Why are you all letting this guy out? At the end of the day, it's like do you even care about our safety? Because you see this guy is dangerous," said the woman, who only gave her first name as April.

Barnes' rap sheet includes arrests on grand larceny, assault and robbery charges in the 1980s, law enforcement sources say. The offenses escalated to sex crimes in 2001, when he was charged with rape and assault in two attacks in Brooklyn less than two weeks apart.

Authorities believe there may be other victims of the cop impersonator and ask anyone with information to come forward.

-- Michael George contributed to this report.