A 47-year-old Brooklyn ex-con was charged with impersonating a police officer and raping a teen girl on Thursday, more than a month after she was attacked, police said.

Walter Barnes was held in lieu of $250,000 bail, accused of telling an 18-year-old girl on Oct. 2 that he was an officer and that he would arrest her if she didn't perform oral sex on him, according to the criminal complaint.

He was charged with two counts of first-degree criminal sexual act, attempted rape, and criminal impersonation, according to the complaint.

In 2002, Barnes was sentenced to 4 to 5 years in prison for raping and choking two girls, ages 14 and 17, according to the New York State sex offender registry.

Attorney information for Barnes was not immediately available.