Brazil striker Ronaldo became the joint highest scorer in World Cup history as he scored twice against Japan.
The 29-year-old headed in an equaliser before half-time to go past Pele and then curled in his 14th finals goal at the end to go level with Gerd Muller.
Japan had taken the lead through Keiji Tamada's left-foot drive before Ronaldo converted Cicinho's clever centre.
Juninho Pernambucano made it 2-1 with a drive then Gilberto drove home before Ronaldo's 20-yarder wrapped it up.
FULL-TIME: Brazil seal an impressive win courtesy of two goals from Ronaldo and other strikes from Juninho and Gilberto. Earlier Japan had taken a surprise lead through Keiji Tamada but they were completely outplayed in the second half.
90mins+3: Alex very nearly gets a cross in for a final scoring effort but it is swiped clear just moments before the final whistle.
90mins+2: Koji Nakata, no relation of Hidetoshi, tries for another moment of glory at the end but it flies towards the gloves of Rogerio.
90 mins+1: Ricardinho whips in a cross to Gilberto Silva, who appears to make better contact with a team-mate in the box than the ball. It won't faze him too badly though.
90 mins: There's still three minutes of action in this match, but it remains to be seen if there's another goal.
89 mins: Ronaldo and Robinho try to link up for some final heroics in Dortmund. They're swamped by Japan's blue shirts and can't break off the shackles to make it into the final third of the field.
88 mins: Masashi Oguro is through on goal and gets primed to arc it past Rogerio but is waved offside. He looks stunned by the decision but, in his heart of hearts, probably knows it's the right one.
86 mins: Shunsike Nakamura tests newly arrived goalkeeper Rogerio but is just off-target with his free-kick.
84 mins: To their credit, Japan keep on piling forward for a pride-restoring goal, most notably and least surprisingly the Brazilian-born Alex. Japan's fans look destined to cheer them to the final whistle.
81 mins: GOAL Japan 1-4 Brazil
Ronaldo unleashes an absolute beauty - his second of the game. Yoshikatsu Kawaguchi can do little about it as the Real Madrid star swivels in typical Ronaldo fashion, arches his back and coaxes the ball beautifully into the back of the net.
78 mins: While Brazil look to be coasting to victory, Harry Kewell has just unleashed a stunning equaliser for Australia in the other Group F match. It's now 2-2.
75 mins: Brazil's shirts edge ever nearer to a fresh foray on the Japanese defenders, gradually closing up as a unit as they nudge nearer. To Japan's credit, they are coolness personified and almost launch a counter attack of their own seconds later.
73 mins: For a rare moment in an enthralling encounter, the pace dips. You can't blame the players, some of whom must be shattered by the sometimes relentless pace.
71 mins: Ze Roberto and Ricardinho enter proceedings as Kaka and Ronadlinho bow out of the game. The Barca playmaker is still all smiles despite it.
69 mins: Robinho gives a knowing and not entirely pleased glance to Ronaldo. The younger of the Real Madrid stars sprints deep into Japanese territory and weights a pass perfectly across the goal only for Ronaldo to seemingly give up the chase. It's not totally clear why.
66 mins: Japan are showing a never-say-die attitude despite a harsh last 20 minutes. Alex leaves Cicinho in a spot of bother and you get the impression the Japanese could yet find the target again tonight.
64 mins: The shots are coming in thick and fast now. Robinho decides to have a dabble, this time Yoshikatsu Kawaguchi does rather better as he does when Juninho tries to score his second of the night. Meanwhile, recent substitute Naohiro Takahara comes off the field on a stretcher only to return moments later.
62 mins: There are some disappointed Japanese faces in the stands. You can't help but feel sorry for them.
60 mins: GOAL Japan 1-3 Brazil
Gilberto rifles home an absolute cracker as Japan continue to struggle. Ronaldinho is the chief creator as he sends Gilberto sprinting clear, who rather than pick out Ronaldo in the box fires the ball straight along the ground to make it 3-1. He goes suitably nuts in his celebrations.
58 mins: Alex hasn't had the most prolific 10 minutes. He is nutmegged in the box once more (see 51 mins), this time by Kaka. Thankfully for him, his error doesn't prove at all costly.
56 mins: Nico Kovac puts Croatia 2-1 ahead in a terrible Australian mix-up in the other Group F match.
56 mins: Koji Nakata takes the place of Mitsuo Ogasawara.
53 mins: GOAL Japan 1-2 Brazil
Arguably Japan's star of the first half, goalkeeper Yoshikatsu Kawaguchi, has an absolute howler as Juninho has a stab from distance. The ball curls and loops and totally evades Kawaguchi's clutches en route to the back of the net.
51 mins: Ronaldo nutmegs Alex, links up delightfully with Ronaldinho in the box and then toe-pokes the ball towards the goal. It rebounds off the post and Carlos Alberto Parreira's face is a picture as he contemplates what could have been.
50 mins: Juninho and Ronaldinho are like a mirror image as they stand staring at the free-kick opportunity with their hands on their hips. At the last second, Ronaldinho leaves his team-mate too it but all he does in the Barcelona playmaker's absence is curl it straight to Yoshikatsu Kawaguchi.
49 mins: Brazil appear to be toying with Japan so far since the restart. They pass the ball between themselves with ease but are let down when Kaka juggles the ball for a third time and Hidetoshi Nakata dispossesses him.
47 mins: Kaka gets space on the left-hand side after a slick pass from Robinho. He grits his teeth in annoyance when Alex blocks his effort on goal.
46 mins: After a Japanese huddle the players are called to their positions for the second half. The player to get the last touch of the last half, Ronaldo, appropriately gets the first of this half as he kicks off.
PLAYER RATER: Robinho is the pick of the players according to those of you on Player Rater. He's clocked the highest score, to date, of 9.18, but is closely followed by Yoskhikatsu Kawaguchi (9.05) and Keiji Tamada (8.64).
"After Kawaguchi made two brilliant saves, we probably all thought 'here we go'. But the response by Japan was excellent and they made Brazil pay for their careless defending. They will be devastated to concede a goal so late in the half."
Graham Taylor, Five Live Sport pundit
"It's a worry watching Brazil. They're far from their best and I don't honestly know how they're going to change it and improve things so fast - that's not clear at all."
Leonardo, BBC Sport pundit
HALF-TIME: Carlos Alberto Parreira had looked pretty glum faced seconds before Ronaldo's goal with the final touch of the half. His header cancelled out an earlier effort by Keiji Tamada, who gave Japan a surprise lead much against the run of play.
45 mins+1: GOAL Japan 1-1 Brazil
With the final touch of the half, Ronaldo equalises as he heads the ball in at the far corner. Ronaldinho crosses it from one side of the box to the other, Cicinho heads it back in and Ronaldo nudges it into the back of the net. It's his 13th World Cup goal and should go some way to silence his critics.
45 mins: There's an additional minute to play in this captivating half.
44 mins: Japan are very much playing Brazil at their own game with a string of slick passes. It ends with Gilberto fouling Akira Kaji. Quite rightly, he is carded for the challenge...much to Japan coach Zico's delight.
42 mins: Ronaldinho tries to be a bit too clever as he cuts inside on the offensive. He's surrounded by team-mates in good positions, most noticeably Kaka, but he tries to curl the ball into the top-right corner instead. It doesn't work.
41 mins: Junichi Inamoto leaves Ronaldo left bemused with a sweetly timed tackle just as Brazil's front man looks to be goal-bound.
40 mins: Akira Kaji gets the first card of the night and his first of the World Cup. He's deemed to have fouled Gilberto, although replays suggest that's a tad harsh.
39 mins: Craig Moore scores a penalty to level proceedings for Australia at 1-1 against Croatia. Should the results stay the same tonight, Australia will join Brazil in the next phase of the tournament.
38 mins: Pele looks shattered by the goal as he drops steadily in his seat in the stands. Meanwhile, the pace of the game dips for the first time of the night.
36 mins: Brazil really should be all square now. Ronaldo clears the keeper but then mis-directs his pass to Robinho, who similarly mis-directs his shot.
34 mins: GOAL Japan 1-0 Brazil
Keiji Tamada scores much against the run of play. Alex picks him out supremely with a cross into the Brazil box and Tamada lofts it delightfully past Dida. A great goal for Japan to take a surprise lead. But as it stands in Group F, they still need a second to reach the knock-out stages.
32 mins: Ronaldo, sweating as if he's just popped out of a sauna, swivels for another strike. His left-footed effort is slightly mis-timed and it falls neatly for Yoshikatsu Kawaguchi.
30 mins: You've got to love the optimism of the Japanese spectators, and it proves warranted once more when Keiji Tamada pins his ears back and charges into the Brazilian box. Sadly for him he does so without the control of the ball.
28 mins: Lucio makes a bit of a fool of himself in front of the millions of people watching this around the globe when he lines up a shot only to miss the ball completely as he attempts to control it.
25 mins: Akira Kaji very nearly forces an own goal from Gilberto Silva with a nasty little cross towards Dida's goalmouth. Gilberto Silva looks around stunned in the aftermath - clearly he has no idea where the ball is.
22 mins: Juninho comes within a whisker of a sensational goal. Ronaldinho produces a little dance magic on the ball, Ronaldio tidily flicks on and Juninho smacks it. The hero of the night so far, Yoshikatsu Kawaguchi, though, is once more up to the challenge and tips it over the bar.
20 mins: Ronaldo looks to have remembered how to be a world-class striker. He combines his physical strength and agility to beat two defenders and send Yoshikatsu Kawaguchi to the turf once more. Ronaldo's shot is only bettered by Kawaguchi's save.
19 mins: Japan are beginning to capitalise on the space created by Brazil's repeated attacks. Seiichiro Maki darts through to cause Brazilian hearts to skip a beat...but only momentarily.
18 mins: Akira Kaji flies down the right flank and has acres of space and plenty of time to cross the ball. He crosses it - eventually - but misses the three players waiting for the ball in the box.
16 mins: Robinho looks a mighty handful. He delightfully shifts his weight from one foot to the next and manages to rifle in a shot - admittedly over the bar - despite the attentions of at least four Japanese tacklers.
15 mins: Ronaldinho and Juninho eye the ball greedily after Brazil a free-kick. Juninho wins the tussle to take it, much to Brazil's chagrin as it flies way into the stands.
13 mins: Hidetoshi Nakata breaks through Brazil's ranks but his pass is too heavy and a promsing Japanese break falters.
12 mins: Gilberto glides from midfield into attack and curls the ball to Robinho on the other side of the field. Rather than go for grace, Robinho uses power to good effect and forces another timely save from Yoshikatsu Kawaguchi. Brazil look on the cusp of reaching fifth gear for the first time in this World Cup.
10 mins: The fresh-faced Kaka dances across the front of Japan's box and has a wild swipe at the ball. If nothing else, it might help him find his range for future, more accurate strikes.
9 mins: There's two very different styles of play at the moment. Brazil are showing some slick passing while the Japanese players are like niggly livewires. It's got the makings of a captivating contest.
7 mins: Ronaldo nearly silences his critics with a goal - its his best effort of the tournament yet. Some jiggery pokery by Ronaldinho sends him on his way. On receiving the final pass, Ronaldo fires his shot but Yoshikatsu Kawaguchi blocks it with both hands.
5 mins: With the way things stand in the other game, Japan now need to win 2-0 to qualify. They're looking fairly sprightly in the opening exchanges and seem unfazed by the fact they're taking on Brazil.
3 mins: Darijo Srna puts Croatia 1-0 ahead against Australia with a belter in the other Group F match.
2 mins: Keiji Tamada is let down by his ball control in the box while looking goalwards. It still brings an astonishing array of screams from the Japanese contingent in the crowd.
1 mins: Dida is forced out of the safety zone of his penalty area as Japan whip the ball upfield early on for the first attack of the night. It's not a particularly threatening foray forward however.
2000 BST: Japan's new-look strikers get the action going at the whistle.
1958 BST: "Ronaldo has got to deliver. We don't want to see a player of his ilk suffering, so let's hope it goes well, he applies himself and is more like the old Ronaldo."
Graham Taylor, Five Live Sport summariser
1956 BST: For what it's worth, Brazil goalkeeper Dida appears to have the best singing voice of his team. He gives a rousing rendition of Hino Nacional Brasileiro, while Japan coach Zico interestingly sings both national anthems.
1954 BST: Right, it's national anthem time. The Japanese get the chance to sing first. Interestingly enough, it's the Brazilian-born Alex who sings most passionately. His eyes are closed and he has his hand firmly on his heart for the duration of the anthem.
1952 BST: There's a generous cheer in the stands as Pele comes up on the big screen. He's good enough to give everyone a big wave and a cheery grin.
1950 BST: It's a crowded tunnel in Dortmund where Ronaldinho, as is his custom, is all smiles as he shakes hands with everyone and anyone. Ronaldo, however, looks a tad more serious faced.
1947 BST: "Everybody wants more energy from Brazil - that's what the World Cup's all about. The players have to show more - that much is expected. They're improving and you can see it in their faces. Tonight I expect them to do better."
Leonardo, BBC Sport pundit
1940 BST: Should Cafu come off the bench tonight he will equal the record for the most World Cup appearances by a Brazilian. He is currently tied with Dunga and Claudio Taffarel on 18 but some way off the overall tournament record by Germany's Lothar Matthaeus on 25.
1933 BST: Japan have to beat five-time world champions Brazil and hope Croatia defeat Australia in the other Group F match to keep alive their hopes of reaching the knock-out stages.
1926 BST: Both coaches have named new-look line-ups for their final Group F match. Japan coach Zico has opted for a changed strike partnership - Keiji Tamada and Seiichiro Maki taking the places of Naohiro Takahara and Atsushi Yanagisawa.
Brazil boss Carlos Alberto Parreira has relegated Cafu, Roberto Carlos, Emerson, Ze Roberto and Adriano to the bench but he keeps faith with Ronaldo up front.
Japan: Kawaguchi, Santos, Tsuboi, Kaji, Nakazawa, Hidetoshi Nakata, Ogasawara, Nakamura, Inamoto, Maki, Tamada.
Subs: Doi, Endo, Fukunishi, Komano, Moniwa, Koji Nakata, Narazaki, Oguro, Ono, Takahara, Yanagisawa.
Brazil: Dida, Lucio, Juan, Cicinho, Gilberto, Kaka, Ronaldinho, Silva, Juninho, Ronaldo, Robinho.
Subs: Adriano, Cafu, Carlos, Cris, Emerson, Fred, Julio Cesar, Luisao, Mineiro, Ricardinho, Rogerio, Ze Roberto.
Referee: Eric Poulat (France)