The crowd gathered in Nicholson Square after word spread on social media that officers had raided the Beirut restaurant and arrested people inside.
Police vans, cars and officers lined the streets around the square, and closed off the road on either side, meaning traffic from Potterrow had to be diverted.
Protestors, many of whom were wearing masks, stood on the street outside the restaurant. Two were also seen sitting on top of a police van.
Shortly before 8.30pm on Thursday , the crowd cheered as the immigration team left the building, having earlier agreed to de-arrest those inside.
Among the crowd was a bagpiper playing Scottish songs; sending a message that he believes everyone is welcome in his country.
Others chanted ‘this is what democracy looks like’ and ‘people united, we’ll never be divided’.
One man, who was in floods of tears, was comforted and hugged by emotional protestors.
Speaking to the Evening News, one University of Edinburgh student called Lizzie said she had been at the square for around two hours.
On why she chose to attend the protest, she said: "I don’t think any human is illegal and I think we should be supporting everyone and everyone we can.
“When everyone heard about what was happening, we just dropped everything and moved.”
She added that she and her friends, Hazel and Susan, had planned to stay at the square until whatever time the police were seen to leave.
"We will disperse when we see the police leave the building, get in their cars and go. And we hope they won’t come back later tonight.
"That would be a success for us.”
Another student, Judith Jacobs, stood on the square holding a handmade sign, which read ‘stop deportation’.
She said that, since she arrived at the square at around 6pm, the crowd just ‘got bigger and bigger’.
“It started out a few people and it has grown. Then the police arrived,” she said.
“We didn’t actually see any immigration officers go in. They were already in there by the time we got here.”
The Home Office has been approached for comment.