Storm Doksuri has been causing widespread flooding and has led to chaos across northern China.
In the capital, at least 31,000 people have been forced to flee their homes, while subway stations have been closed.
While the storm - a former super-typhoon - is weakening, officials have urged people to remain indoors.
A red alert has been issued in the city and employers have been ordered to allow people to work from home, with the death toll from the severe flooding expected to rise in the coming days.
Rainfall in Beijing and other cities in northern China has already reached dangerously high levels, while driving rains are expected to continue for at least another 24 hours.
China's Meteorological Bureau said an average of 170.9 millimetres of rain deluged Beijing between Saturday night and noon on Monday, the equivalent of the average rainfall for the entire month of July.
The storm made landfall in Fujian Province on Friday, causing landslides and flooding before moving north towards the capital.
In footage shared online by Beijing residents, cars could be seen being swept away by torrential rains and there are fears that passengers could have been trapped inside after waters rose rapidly. Some roads were also torn up by the severe flooding.
Elsewhere, subway stations were engulfed by the flooding, while to the south of the city, a railway bridge was washed away. Dozens of flights have also been cancelled to and from the city.
In the Mentougou district, emergency officials recovered the two bodies from waterways early on Monday, state media reported. About 5000 people have been evacuated from the mountainous district.
Guo Zhenyu, a 49-year-old resident, told the AFP news agency that the heavy rains had quickly submerged much of the area.
"This morning it was crazy, the water overflowed the Mentougou river and the whole avenue was flooded," he said.
Other residents expressed concerns that the rains could cause structural problems for their homes.
"Once it starts raining, the road turns into a drain, and there's water on the first floor inside houses," Chen, 52, told AFP.
"The houses here are all old houses, so there are definitely concerns about safety."
In the Fangshan district, state media reported that some 2000 members of the People's Liberation Army had been deployed to help shore up flood defences against the rising waters.
Meanwhile, in southern China, typhoon Khanun is expected to hit the heavily populated Zhejiang Province in the coming days.
The floods mark the latest example of extreme weather to hit China this summer. The country has been consistently posting record temperatures, which scientists say have been exacerbated by climate change.
The world has already warmed by about 1.1C since the industrial era began and temperatures will keep rising unless governments around the world make steep cuts to emissions.
The warmer it becomes, the more moisture the atmosphere can hold. This results in more droplets and heavier rainfall, sometimes in a shorter space of time and over a smaller area.