Pekka Rinne started in goal for Nashville before being replaced by Jeremy Smith around the halfway point of the second period.
Smith saved the shutout by stopping a blast by Ovechkin in the closing seconds.
It was the first hockey game in the city since the Baltimore Bandits of the American Hockey League left town 14 years ago. The Capitals last played in Baltimore in 1992, against their then-AHL affiliate, the Baltimore Skipjacks.
Dubbed the 2011 Baltimore Hockey Classic, the game drew a near-sellout crowd of 11,082 -- even though ticket prices ranged from $34 to $147.
Capitals coach Bruce Boudreau played 17 games for the Skipjacks during the 1984-85 season, and Nashville coach Barry Trotz was an assistant coach with the Skipjacks.
On this occasion, the building was hot and there were small puddles on the ice. But the players made the best of it.