The two major cities were among several places in China that implemented curbs to stop the spread of the Omicron wave during March to May, with Shanghai imposing a two month-long city-wide lockdown that lifted on June 1.
The efforts, part of China's adherence to a zero-COVID policy that aims to eradicate all outbreaks, have brought case numbers down but many of the heavy-handed measures have fuelled anger and even rare protests and taken a heavy toll on the economy.
Beijing shut its schools in early May and asked students to move to online learning amid a spike in locally transmitted COVID cases. Senior year students at middle and high schools were allowed to return to classrooms from June 2.
On Saturday, with case numbers trending lower in recent days, the capital's education commission said all primary and secondary school students in the capital can return to in-person classes from Monday. Kindergartens will be allowed to reopen from July 4.
The Beijing Municipal Bureau of Sports said separately that sports activities for the young can resume at non-school locations on June 27 in areas where no community cases have been reported for seven consecutive days, with the exception of basement venues, which will remain shut.
The Universal Beijing Resort, which had been closed for nearly two months, reopened on Saturday. Read full story
Meanwhile, Shanghai reported no new local cases - both symptomatic and asymptomatic - for June 24, the first time the Chinese economic hub had done so since Feb 23.
Shanghai Communist Party chief Li Qiang said at the opening at the city's party congress on Saturday that authorities had "won the war to defend Shanghai" against COVID by implementing the instructions of Chinese President Xi Jinping, and that Beijing's epidemic prevention decisions were "completely correct".
The city, however, remains on edge. Most students have not been allowed to resume in-person classes and dining indoors is still banned. It also plans to continue conducting mass PCR testing for its 25 million residents every weekend until the end of July.