The outbreak has been linked to the city's largest wholesale market.
A total of 45 people out of 517 tested at the Xinfadi market tested positive for Covid-19, a district official said. None were displaying symptoms.
Lockdowns have been imposed in 11 nearby neighbourhoods, while 10,000 market staff will be tested.
The authorities also want to test everyone who has had recent contact with the market as well as those living in the district surrounding it.
These are the first new confirmed cases in Beijing for more than 50 days.