A black man who was confronted and asked to leave the pool at the apartment building where he lives in a viral video says he was the victim of racial profiling.

Indiana resident Shayne Holland used his cellphone to record a confrontation between himself and a security guard who was an off-duty Indianapolis Metropolitan Police Department officer last Friday.

The incident happened when he was sitting at the pool at the River Crossing Apartments, where he has lived since February 2017, according to the Indianapolis Star.

"I had my headphones when she approached me so I didn't hear her the first time. When I asked her to repeat herself, she asked if I lived in the neighborhood. I said yes," Holland told the Star. "When she asked where I lived, I said I don't know you and you haven't identified yourself, so I'm not just going to give you my address."

The man said he presented the officer, whose name was not immediately available, with a key he was issued from the apartment complex that allows him access to the pool.

The officer then contacted the complex's property manager to confirm Holland was a resident, which the manager did confirm.

But the situation continued to escalate in the video posted on Twitter. The officer, who is wearing a badge, continues to press Holland in the video. He repeatedly says he is uncomfortable giving the officer his address.

"Why do I need to give this lady, who I don't know, my address?" Holland asks in the video, while noting that he paid $1,600 in rent for the following month.

Holland was then told to leave the pool by the officer.

"Why do I have to leave my pool?" he asked.

The manager said in response that the man was being told to leave because he refused to answer the officer, who was working as security while off-duty as a police officer, according to the Star.

Alex Stokely, the vice president of Barrett & Stokely, which manages the apartment complex, told the local publication that the manager has since been placed on leave. The company also added that they are currently investigating the situation.

The security officer was reportedly at the pool because of previous incidents involving nonresidents using the pool, according to the Star.

The viral video is the latest in a series of widely publicized similar incidents captured on video.

Two black men were arrested in a Philadelphia Starbucks earlier this year while sitting in the cafe without ordering anything.

Another viral video from June showed a white woman, dubbed by social media users as "Permit Patty," calling 911 on a black girl selling bottled water in San Francisco.

Several other incidents have involved confrontations at community pools.