I was racially profiled at the New York Public Library, and it was humiliating.

As a 32-year-old black man, up to now, I had been “fortunate” enough to escape being approached by a security guard or police officer, but I know plenty of people who have.

In fact, I have always feared that my day would come, and it did on the eve of the presidential election.

“Hi Carlos — we’d love to have you join us on this coming Monday, November 7 for the New York Public Library’s Library Lions Gala which will commemorate the 50th Anniversary of Truman Capote’s Black & White Ball,” an email from the organizers read.

I was thrilled because civil rights icon and humanitarian Harry Belafonte was being honored. When I arrived to the library, I chatted with Ken Sunshine of Sunshine Sachs, the PR team that handled the publicity and provided me with my press badge.

I received my seat number at another checkpoint. An event staffer was waiting at the elevator to tell me which floor to exit on. Another person directed me to the cocktail hour when I exited the elevator. I went into reporter mode and wandered the room to see who was there, but I could feel someone hovering over me.

An older black man in a security blazer appeared, leaned into my ear and said, “I don’t want to offend you. Please don’t take this the wrong way, but how did you get invited to this?” “I’m a reporter covering this event,” I replied. “Do you have an email? I’m only asking because someone from events told us a guy walked in without showing an email and you fit the description,” he said.

“You fit the description.”

I am thinking there’s no way someone from their events team flagged me as a crasher because I’ve worked with them for many years. I showed the security guards my press pass and seat assignment for the event and told them I was reporting for The Post.

“Who is your boss?” I asked. A husky white guy wearing a similar blazer stood behind me and repeated, “You matched the description…”

After I confirmed my right to be there, the first security guard, said, “I pulled you to the side because I didn’t want to offend you. Please enjoy your evening.”

Who was the other young black man with an afro in a room full of mostly white senior citizens? I am the description.

Should I be thankful because he pulled me aside in order to not “offend me”? I was stunned. What just happened? And how did this just happen at an event where Harry Belafonte was being honored? Do I use the “r” word when I explain what happened to the events people downstairs? God forbid I come across as that black person pulling the race card. It was devastating. I felt embarrassed and humiliated.

I left immediately. “You fit the description” rang in my ears for the rest of the night. This is what it feels like to be told I shouldn’t be somewhere because of how I look. “Well, at least I heard it at a fancy gala as opposed to being wrongfully pulled over, or something worse,” I thought.

Carrie Welch, the library’s chief external relations officer, called me the next day. She wanted to tell me “how sorry I am and what we’re doing … There actually was a crasher and you did fit the description.”

I responded: “Who was the other young black man with an afro in a room full of mostly white senior citizens? I am the description.” She laughed. We hung up.

On Thursday, the library was still unable to identify the crasher or tell me who flagged me to security. But I now know what it feels like to “fit the description” when security feels I don’t belong in the room.

The New York Public Library receives millions in public and city money every year to meet its nearly $150 million operating budget. It is a tragedy that it can only be comfortably enjoyed by those of a “certain description.”

The New York Public Library later issued an apology. Read the full apology here.