BEIJING (Reuters) - China’s parliament has banned private, for-profit schools that teach first- through ninth-graders, a move to tighten government control over education that may cool a fast growing but poorly regulated sector.

Leaders of the National People’s Congress adopted a revised law on private education that banned the schools, according to a document released on Monday at the end of a bi-monthly session.

The education sector has boomed in China in recent years - and become a magnet for investment - as the government relaxed restrictions to help meet growing demand and to increase options.

Regulation has been weak, however, leading to widely varying standards of quality.

Chinese children are entitled to nine years of free, compulsory education, from elementary to junior high school.

The document said it was acceptable to set up private, profit-generating schools at other grade levels, “but they cannot establish compulsory education (level), for-profit, private schools”.

The adoption of the revised law comes not long after the Shanghai government told principals from 21 international and bilingual schools in the city to offer China-specific subjects, according to the news magazine Caixin last week.

Greater government control of education follows a tightening of oversight of a range of areas since President Xi Jinping became Communist Party boss in 2012, including over information, news and the internet. The government has campaigned against the spread of “Western values” at universities.

Caixin last week quoted unidentified sources as saying the legislators were motivated by concern that the proliferation of often-expensive private schools would widen inequalities in access to basic education.

The change would affect about 10,700 schools and as many as 12 million students, it reported.