The amendment, passed at a meeting of the standing committee of the Shanghai Municipal People's Congress, will come into effect March 1, the legislature said in a statement.
Shanghai now faces a spate of demographic challenges, including a low birth rate, an ageing population and an unbalanced population structure, Xinhua reported citing the Shanghai Municipal Commission of Health and Family Planning.
Similar reasons were cited when the third plenary session of the 18th Communist Party of China Central Committee decided to ease the decades-old one-child policy in November last year.
About 75,000-150,000 newborn babies were expected to be added to the city's population in the next three to five years, said the Shanghai Municipal Commission of Health and Family Planning.
Currently about 370,000 families in Shanghai are eligible for the eased policy.
Xue Mingyang, head of the committee of health under the Shanghai Municipal People's Congress, said the authorities would seek to provide better health and education services to cope with the rise in newborns.
In addition to Shanghai, the Beijing and Tianjin municipalities, and Zhejiang, Jiangxi and Anhui provinces have already changed their policies.