​Nikolas Padilla, 18, spent the night in central booking after he was attacked by an enraged passenger of a car. View Full Caption DNAinfo/Gwynne Hogan

WILLIAMSBURG — A Brooklyn cyclist claims a passenger in a car yelled a racial slur at him, spat on him then punched him in the face — yet he was the one who spent a night in jail.

The passenger was charged with assault and given a ticket for attacking Nikolas Padilla last week — then he was allowed to leave the scene, police said.

But Padilla was charged with menacing and criminal possession of a weapon for swinging his bike lock — which he denied, saying the lock was fastened round his waist when police arrived — and was taken into custody.

The incident happened on Clymer Street, near the intersection of Kent Avenue in Williamsburg, at 12:15 p.m. Sept. 6, just two days before 18-year-old cyclist Padilla was slated to start his freshman year at Monroe College, police said.

​Nikolas Padilla's wheel was busted after a driver backed over it, he said. View Full Caption DNAinfo/Gwynne Hogan

"I wasn't looking for any trouble," said the cyclist, who rides competitively with Echelon Cycles. "I was just going about my day."

Padilla said he was stopped at a red light in front of a car that started honking repeatedly at him once it turned green.

As the car swerved past him, the passenger rolled down his window, he said.

"This dude just lowered the window. He spit on me twice," Padilla said. "He basically told me to, 'Shut the f--k up, n---er.'"

The vehicle drove off, turning south on Kent Avenue, and Padilla kept riding in the same direction. He caught up with the car on Williamsburg Street West when it stopped at a red light just before Flushing Avenue.

As he approached the car, he said he checked the driver's side mirror, as he's grown accustomed to doing since he's been hit by doors twice before. In the mirror he made eye contact with the female driver right before she swung open the car door, he said.

"She opened the door at me. I had nowhere to go because I was basically trapped," he said.

Padilla rammed into the door and fell to the ground.

The passenger in the car got out and punched him twice in the face, Padilla said. He claimed the driver then backed over the wheel of his bicycle, he said.

Police arrested Padilla and the car's passenger, Christopher Cicero, the president of SmarterWiki Inc, a company that claims to lobby Wikipedia for its clients.

Cicero was given a Desk Appearance Ticket for punching Padilla, though the arrest report does not mention the claims that he uttered a racial slur or spat on the cyclist.

Padilla said he mentioned the slur repeatedly to officers on the scene and later filed a second report on the incident at the 90th Precinct.

The driver wasn't arrested or ticketed.

"It makes no sense to me. This dude punched me in the face. I'm hurt. My bike got ran over," said Padilla, whose eye was still swollen two days after the incident. "They arrested me.

"I spent the night there on a super cold floor. I feel like I wasn't even taken seriously."

A police spokeswoman said that Cicero could still face additional charges, though that was up to the District Attorney's office.

Padilla and his mother are now working on filing an incident report with the state Department of Motor Vehicles and a separate complaint with the Civilian Complaint Review Board over the police's handling of the incident.

Cicero didn't respond to multiple requests for comment.

Wednesday night, after he got back from jail, Padilla slept in his mother's bed, she said.

"He woke up actually crying," said his mom, Aurea Bayona.

"'I don't understand why? Why this had to happen? Why he had to spit in my face? Why he had to hit me and why the cops didn't even take my side into consideration?'" Bayona recalled her son saying.

"That's a hurtful feeling for him and for me too."