Protesters have been on the the streets since Freddie Gray's death on 19 April - a week after a police encounter where he sustained unexplained injuries.
Shops have been looted and objects thrown at police, injuring several officers.
It was the first time in the history of professional baseball that fans had been locked out of a game.
The game at Camden Yards started at 14:05 EDT due to the city's 22:00 curfew in the wake of the riots, with Baltimore winning 8-2.
Among the few able to witness the match were those who had paid for balcony rooms in the nearby Hilton Hotel, which overlooks the stadium.
Journalists accredited to cover the game reported that the voices of players on the infield could be heard clearly.
"Attention media: For record-keeping purposes, today's official paid attendance is ... zero," an announcement made over the press box public address system said.
Other reports said the stadium still played the traditional US baseball anthem - Take Me Out To The Ballgame - during the traditional seventh-inning stretch.
The Orioles and Major League Baseball officials had said the decision to shut out fans had been taken for safety reasons.
But Brendan Hurson, one of the 40 spectators gathered by a fence near the stadium's main gate, said it was a missed opportunity and held up a sign reading "Don't forget Freddie Gray".
Six police officers have been suspended following Gray's death and an internal investigation is under way.
On Sunday, more than 1,000 protesters were on the streets of Baltimore and at least 12 arrests made.
Gray, who was 25, is the latest of a series of black Americans to die in police custody in recent months, triggering angry protests accusing the police of brutality.

The study in Scientific Reports suggests every hour spent using a touchscreen each day was linked to 15 minutes less sleep.
However, those playing with touchscreens do develop their fine motor skills more quickly.
Experts said the study was "timely" but parents should not lose sleep over it.
There has been an explosion in touchscreens in the home, but understanding their impact on early childhood development has been lacking.
The study by Birkbeck, University of London, questioned 715 parents of children under three years old.
It asked how often their child played with a smartphone or tablet and about the child's sleep patterns.
It showed that 75% of the toddlers used a touchscreen on a daily basis, with 51% of those between six and 11 months using one, and 92% of those between 25 and 36 months doing so as well.
But children who did play with touchscreens slept less at night and more in the day.
Overall they had around 15 minutes less sleep for every hour of touchscreen use.
Dr Tim Smith, one of the researchers, told the BBC News website: "It isn't a massive amount when you're sleeping 10-12 hours a day in total, but every minute matters in young development because of the benefits of sleep."
The study is not definitive, but Dr Smith says it "seems to indicate touchscreens have some association with possible sleep problems".
However, his research has also shown toddlers who actively use touchscreens (swiping rather than watching) accelerate their development of motor skills.
So should children be given touchscreens to play with?
Dr Smith says: "It's very tricky right now, the science is very immature, we are really lagging behind the technology and it's too early to make clear proclamations."
He says the best bet is to follow similar rules for the amount of time spent in front of the TV.
That means putting a limit on the total time spent on devices, ensuring children still do physical things, ensuring that content is age-appropriate, and avoiding the screens in the hour before bedtime.
Dr Anna Joyce, a cognitive developmental researcher at Coventry University, said: "As the first study to investigate associations between sleep and touchscreen use in infancy, this is a timely piece of research.
"In light of these findings and what we know from previous research it may be worth parents limiting touchscreen, other media use and blue light in the hours before bedtime.
"Until we know more about how touchscreens affect sleep, they shouldn't be banned completely," she added.
Prof Kevin McConway, from The Open University, said: "I certainly wouldn't lose any sleep over these results, if I still had young children.
"The children in this study used a touchscreen for about 25 minutes a day, a child who used a touchscreen for this average length of time would sleep for about 6 minutes less."
Follow James on Twitter.
Fans were locked out of Baltimore Orioles' game against Chicago White Sox following violent protests in the city.
[NEXT_CONCEPT]
Toddlers who spend time playing on smartphones and tablets seem to get slightly less sleep than those who do not, say researchers.