The city of 21 million has already ordered three rounds of mass testing this week for the virus, with the third due to take place on Friday, and closed down some communities where cases were found.
The fatalities were the first reported in China since January 26, 2021, and bring the country's total death toll in the pandemic to 4,638. In all, China reported 4,051 new cases on Saturday, down from 4,365 the day before, the commission said.
Around 25 million people remain locked down in China's largest city and financial centre, as authorities try to snuff out the country's most severe virus outbreak since the end of the first pandemic wave in early 2020.
After originally taking a more piecemeal approach aimed at minimising economic disruptions, Shanghai imposed broader restrictions last week as authorities struggled to contain what has become the city's biggest COVID-19 outbreak.
Since March, a patchwork of restrictions has kept most of the city's 25 million residents confined to their homes or compounds, with daily caseloads regularly edging over 25,000.
Chengdu, in the southwest, has become the latest to announce a shutdown, saying in an official notice that residents must "stay home in principle" from 6pm on Thursday to combat a new wave of infections.
Beijing is on high alert for new outbreaks as it prepares to host the Winter Olympics next month, sticking to a "zero-Covid" strategy of targeted lockdowns, border restrictions and lengthy quarantines.
Spain, South Korea and Israel on Friday joined nations imposing COVID-19 tests on travellers from China, after Beijing dropped foreign travel curbs despite surging cases.
The move is likely to be greeted with joy from Chinese citizens and diaspora unable to return and see relatives for much of the pandemic.
The latest decision could send free-spending Chinese tourists to revenue-starved destinations in Asia and Europe for Lunar New Year, which begins on Jan.22 and usually is the country's busiest travel season. But it also presents a danger they might spread COVID-19 as infections surge in China.