Nearing the end of his trial on federal sex trafficking charges, Benjamin Biancofiori squared off with a seasoned prosecutor Tuesday who asked, “you understand the rules in this courtroom, right?”

“You understand that I ask the questions,” Assistant U.S. Attorney Erika Csicsila said. “And do you understand that you answer my questions?”

Biancofiori sneered back as she pushed one more time, asking whether he liked the rules.

“I don’t like you,” he said, “for everything you’ve done to me.”

So it went during Biancofiori’s contentious cross-examination ahead of closing arguments in his trial at the Dirksen Federal Courthouse.

The feds say Biancofiori, of Naperville, spent nine years as a “violent pimp” using money, drugs, mind games and vicious beatings to control his young, vulnerable victims. He has not denied the prostitution.

“You’re a pimp, isn’t that right?” Csicsila asked at one point.

“I am a pimp,” Biancofiori said. “And I’ve told everybody this repeatedly.”

Later, Csicsila told jurors that Biancofiori was a “master manipulator.”

“Someone who used lies and threats and violence to get women to go out and have sex for money and then turn all of that money back over to him,” Csicsila said.

But Biancofiori’s defense attorney told jurors he “did not make these women do a thing that they didn’t decide that they wanted to do for themselves.”

The prosecutor spent much of her cross-examination of Biancofiori going over a book he wrote. He claims it is a work of fiction. In it, he explained that a pimp is “someone who knows how to get into a b—-‘s mind and stay there. He can get a b—- to do anything for him at any time.”

In another section he wrote, “I was a pimp, and pimps don’t put cash in hoes pockets. They put dreams in their heads, d— in their mouth, and a foot in their a–.”

But he testified Tuesday that he “embellished events to sound good for the book.”

He admitted he liked jewelry. But when Csicsila asked whether he paid $1,200 for a diamond pendant, he corrected her and said, “let’s just be honest. I believe the charm was $12,000.”

“At least if you’re going to make me look bad, do a good job,” Biancofiori said.

He continued to acknowledge physical altercations with the women he worked with, telling jurors it was “nothing I condone.”

“Yes or no, you beat them up?” Csicsila said.

“That’s a broad statement,” Biancofiori said.

Later, as her cross-examination ended, Csicsila insisted, “you are a violent, manipulative pimp.”

“That’s not true,” Biancofiori said.

“That is absolutely true,” she declared.