China, the world’s most populous country, is ending its one-child policy nearly four decades after it first adopted the practice.

Here’s Xinhua, the state-run Chinese news agency:

China will allow all couples to have two children, abandoning its decades-long one-child policy, according to a communique issued Thursday by the Communist Party of China (CPC).

The move by the party’s Central Committee, which came on the final day of its fifth plenum, is not unexpected. The policy was unpopular among ordinary Chinese, and those who violated it faced punishments ranging from fines to forced abortions.

Beijing had eased the policy several times since it was first adopted in 1979. Two years ago, at a similar party conference, China allowed couples to have a second child if one parent was an only child. Before that, it allowed couples to have a second child if both parents were only children.

NPR reported at the time that despite the policy’s easing, not many Chinese couples were likely to have a second child because “raising a child in China is now very expensive,” particularly in the cities.

Indeed, despite estimates that the tweak would add up to 2 million extra births a year, only 700,000 couples applied to have a second in 2014, Chinese officials said.

One reason for the policy change: demographics. The policy that was introduced to slow China’s population growth worked—too well.

As NPR’s Frank Langfitt noted:

China’s labor is peaking, and state demographers have actually been talking to the central government for years begging them to change the policy, and they say, ‘We’re going to head into a real labor shortage coming up because of the policy.’”

Writing in The Atlantic, Adam Pasick noted the long-term consequences of the policy change in 2013: a larger labor force; more consumer spending; happier people; a smaller gender gap; a healthier housing market; and increased strain on natural resources.

It is estimated that the one-child policy prevented the births of 400 million children since its adoption. China is home to 1.37 billion people, making it the most populous nation in the world, but its growth rate has slowed, increasing 0.5 percent in 2013; that’s against 0.7 percent in the U.S. and 1.2 percent in India, the world’s second-most populous nation.