With the game poised at 13-12, England captain Courtney Lawes cantered in for a try as the Japanese players stopped, expecting to hear the referee’s whistle for a knock-on. However, the ball had deflected off the considerable head of prop Joe Marler and the try stood.
That turned the tide as England ran in four tries in all - having scored only five in their previous five matches - with George Ford again superb off the tee.
For the first 50 minutes though England had looked devoid of ideas, routinely kicking away possession, making way too many errors and some inexplicable decisions, and they were even booed by their own frustrated fans at one point.
They finished in total command, however, and top the Pool D standings with nine points. Japan and Samoa have five, with Argentina and Chile pointless.
England face Chile next weekend then have a two-week break before their final game against Samoa with a quarter-final against either Wales, Fiji or Australia looming.
"We knew we would get the rewards if we kept doing the right things," said England coach Steve Borthwick.
"The players have got to find a way to get the result. You saw a Japan team who kicked the ball 37 times, which tells you a lot about the conditions tonight."
Ford added: "It was probably not the prettiest watching but it's really hard to play with the ball in these conditions. These late kick-offs are dead greasy but we got there in the end."
Japan showed all the pace in movement in the early stages and led 6-3 before England finally got their first try of the tournament when they disrupted a five metre lineout and Lewis Ludlum was carried over.
Ford converted but then missed for the first time in the World Cup with a long penalty, and instead Rikiya Matsuda landed his third to close the gap to 10-9.
England’s travails were summed up near the end of the first half as they turned down a shot at goal to kick to the corner but then dropped the slippery ball peeling off the maul.
Lesson learned, they went for the posts with another penalty to make it 13-9 at the break.
Not much initially changed in the second half as Ford, whose three drop goals in nine minutes broke Argentina’s spirit last week, never once seemed to consider the option on Sunday.
Instead it was Japan who got the first points of the half as a Matsuda penalty after 54 minutes brought them back to within a point.
England were then given their huge slice of luck as a wild pass looked to have been knocked on, only for a TMO review to show that the ball hit Will Stuart’s shoulder and then Marler’s head, and Lawes, who had dotted the ball down almost apologetically, was given the try.
It was all England from then on. A perfect Ford kick found fullback Freddie Steward who did superbly to get the ball down, and then some crisp passing and hard lines opened the way for Joe Marchant to blast through for a bonus-point fourth at the death.
Japan coach Jamie Joseph was happy with the pressure his side initially delivered but said England handled it well as his team's remarkable run of seven successive pool wins came to an end.
"We have to learn from that and the next two games (against Samoa and Argentina) will be about converting from that pressure if we are to make the quarter-finals," he said.