Maya Peterson (inset), the first black female student president at the country's most expensive high school, was forced to resign after mocking her classmates. Photo: Instagram

The first black female student president at an ultra-exclusive New Jersey prep school was forced to resign after posting online photos of herself mocking her “rich white guy’’ classmates.

In a bid to poke fun at the “confederate-flag-hanging” students, Lawrenceville School’s Maya Peterson, 17, wore a Yale sweatshirt and preppy L.L. Bean duck boots while mugging for the camera holding a hockey stick.

Maya Peterson, in a photo posted to her Instagram account.

She dubbed the photos “Lawrenceville boi’’ — and included the hashtags “#romney2016,” “#confederate” and “#peakedinhighschool.”

“I understand why I hurt people’s feelings, but I didn’t become president to make sure rich white guys had more representation on campus,’’ Peterson, told the Web site Buzzfeed.

“Let’s be honest. They’re not the ones that feel uncomfortable here.”

The Paramus, NJ, native stepped down as student president in March, after administrators gave her an ultimatum: either resign or face disciplinary action.

The institution is the most expensive high school in the country, with students paying $53,000 in annual tuition.

Peterson still graduated in June and is set to go to tony Wesleyan University in Connecticut, a former classmate told The Post.

Peterson was unable to be reached for comment.

The dread-locked lesbian student had previously posed for her senior picture with 10 black friends — all of them raising their fists in the “Black Power’’ salute.

“Yes, I am making a mockery of the right-wing, confederate-flag-hanging, openly misogynistic Lawrentians,’’ Peterson said at the time.

“If that’s a large portion of the school’s male population, then I think the issue is not with my bringing attention to it in a lighthearted way, but rather why no one has brought attention to it before.’’

She also had allegedly been caught smoking pot and skipping classes.

“She’s a very smart person … [but] she broke a lot of school rules. Many other kids got kicked out for doing what she did,’’ a former classmate, who took a bio-ethics class with Peterson, told The Post.

The white female student added that she voted for Peterson, “but I don’t know that I would vote for her again.’’

Lawrenceville senior Ramon Olivier, an 18-year-old Hispanic, said, “She got her support from freshmen who didn’t really know who she was.

“I don’t think she deserved to be class president at all. If you want to lead your school, you wouldn’t do all the things she did,’’ he said.

Peterson told Buzzfeed that she’s glad to be done with the school.

“I’m not saying what I did was right. But it wasn’t racist. I was just calling those guys exactly what they are,’’ she said. “And Lawrenceville is the type of place where those kids are idolized.”

The school said in a statement Tuesday, “Every student knows we expect them to meet basic standards for honesty, integrity and respect for others.

“They also know there are consequences for their actions and ultimately they will be held accountable for their behavior. ‘’