Ministers are to announce that sex education will become compulsory for secondary school pupils, while children as young as four will be taught about modern relationships.

Currently sex education is compulsory only in local authority-run schools and limited to biology, but the government has long been lobbied to change the curriculum to include sex and relationship education suited to the modern world.

MPs have called on the government to educate children about new technology and online relationships, sexting and how to spot abusive behaviour.

An amendment to the children and social care bill has been tabled by the Conservative MPs David Burrowes and Maria Miller, a former women and equalities secretary, and backed by dozens of other Tory MPs.

“For the purposes of safeguarding and promoting the welfare of children, the secretary of state must, by regulations, make relationships education a statutory component of the national curriculum within the meaning of part 6 of the Education Act 2002,” the amendment said.

The MPs said the consequences of a failure to teach children about sex and relationships included “physical and emotional harm, including teenage pregnancy and sexually transmitted diseases; girls feeling unable to participate in educational and extra-curricular opportunities; teachers spending valuable time dealing with incidents of sexual harassment and bullying; and young people developing a sense that sexual harassment and sexual violence are acceptable behaviours, and learning social norms that are carried through to adult life”.

In November, the chairs of five parliamentary select committees sent a strongly worded letter to the education secretary demanding a change in policy and said failing to act would have long-term consequences for a generation of young people currently receiving much of their sex education online.

The letter was signed by the Tory MP Neil Carmichael, chair of the education committee; Miller, now the Tory chair of the women and equalities committee; Labour’s Yvette Cooper, chair of the home affairs committee; the Tory MP Sarah Wollaston, chair of the health committee; and the Labour MP Iain Wright, chair of the business, energy and industrial strategy committee.

A No 10 spokesman said: “The department will be saying more than this in due course. High quality relationship and sex education is an important part of preparing young people for adult life.

“The education secretary has been clear she is looking at options to make sure children have access to education in those subjects. Clearly, there is a threat online and that threat has grown and now is the right time to look at how we can ensure children can have the access they need to teaching about those subjects.”

Miller said compulsory SRE was an area where there was a “growing consensus, not division” in the Conservative party and across the House of Commons. “I think the government can see the writing is on the wall and they need to publish new regulation on compulsory sex education in our schools,” she told the Guardian.

“The amendment will be put to the House unless we hear something from the government which really delivers what we know people are crying out for. I don’t mind if it is our exact amendment or the government publishes its own, what I want to see is action. And there is overwhelming evidence that the vast majority of parents and children want those lessons in schools which are age-appropriate.”

Ministers led by the culture secretary, Karen Bradley, have begun work on a new internet safety strategy to protect children and young people from online abuse and grooming. A green paper is expected in the summer.