Magid Magid, the MEP for Yorkshire and The Humber, said a passer-by stopped him on his first day in the role and asked if he was lost.
The stranger then told him to leave the building.
“I know I’m visibly different,” he said on Twitter.
“I don’t have the privilege to hide my identity. I’m BLACK & my name is Magid. I don’t intend to try fit in. Get used to it!”
The Green Party MEP said he “obviously didn’t leave” the building.
“But to even be put in this position says a lot about what people think the stereotypical politician is meant to look like,” he added.
The first tweet was accompanied by a picture of Mr Magid, who was wearing a baseball cap and a t-shirt emblazoned with the words “f**k fascism.”
The 29-year-old, who came to the UK as a child refugee from Somalia, is the former lord mayor of Sheffield.
In 2018 he made headlines for issuing a ceremonial ban against Donald Trump, declaring the US president barred from visiting the city.
Mr Magid was one of six MEPs elected to represent Yorkshire and the Humber in May 2019.
Three seats went to the Brexit Party, while Labour, the Liberal Democrat and the Greens picked up a seat each.
More about: EuropeanParliament