From 3 April, anyone aged 18 or older who sends a child aged under 16 emails, text messages, letters or other forms of on- or offline communication with sexual intent could be prosecuted.
Justice Secretary Elizabeth Truss said mobile phones and social media had made children more vulnerable to "those who prey on their innocence and exploit their trust".
"This new offence will help to us tackle the early stages of grooming, and nip in the bud those targeting children online or through text messages," she said.
NSPCC chief executive Peter Wanless thanked Truss for "doing the right thing", and said the new law would "give police in England and Wales the powers they need to protect children from online grooming, and to intervene sooner to stop abuse before it starts".
The charity has campaigned for the offence to be introduced since 2014, prompting 50,000 people to sign a petition backing the change in the law.
Wanless added: "It is a victory for common sense. Children should be as safe online as they are offline, wherever they are in the UK."
The sexual communication charge will be introduced through section 67 of the Serious Crime Act 2015.
The government is also bringing forward plans to introduce a system of victims of child sexual offences delivering court evidence through pre-recorded videos.
The Ministry of Justice was to start the scheme next year, but following a pilot that found child victims felt less pressure giving pre-trial evidence, and were better able to recall events, it will begin in September.
Pre-recorded evidence is already being used in some parts of the country, where it has led to more early guilty pleas, fewer cracked trials and victims reporting a more positive experience of the court process.