The singer could not help but intervene when he made the film.
Red Nose Day viewers watched how singer Ed Sheeran paid for a hotel to rescue children in Africa from abuse.
The star was on a trip to Africa to make a video for the special Comic Relief programme, and could not help intervening when he saw a child being beaten.
Back on the live BBC programme, he then defied the watershed by telling viewers how small children are often raped by older ones in the slums he visited.
The camera crew filmed the Shape Of You singer, 26, as he debated with himself on the spot about what to do.
Viewers have described Ed as a “hero” for making the decision to step in while making the film.
One wrote on Twitter: “Ed Sheeran is a hero, not many celebrities would have stayed and help them children, giving them safety and a place to stay #comicrelief.”
The singer urged viewers to donate to Comic Relief to help protect children around the world still living in danger of abuse and poverty.
Earlier in the programme, viewers saw him meet Peaches, a young girl who had lost her father during the Ebola crisis.
He broke down in tears after hearing her sing, saying that witnessing the situation himself had been far worse than he had ever imagined.
Red Nose Day viewers can donate on the night either online at bbc.co.uk/rednoseday or by phone using 03457 910 910 or through text. To donate £10 by text, text YES to 70210 and to donate £20 text YES to 70220.