Ted Brown's 10-yard touchdown run with 1:49 to play today led the Minnesota Vikings to a 28-21 upset of the defending National Football League champion San Francisco 49ers, making Bud Grant's return to coaching a triumphant one.

"It feels really great to beat the best," Brown said. "To be the best you have to beat the best."

Brown's winning sweep around left end followed a fumble on a kickoff return by Derrick Harmon, the second of two San Francisco fumbles in the final 3:27 and their fifth lost fumble of the day.

Joe Montana also had two passes intercepted as the 49ers finished with seven turnovers.

"It was an inspired Minnesota team that thought they could win and a San Francisco team that gave it away," said 49ers Coach Bill Walsh.

Grant retired after the 1983 season but was brought back to replace the fired Les Steckel, whose 1984 Vikings were 3-13.

Grant said the 49ers may have been demoralized because they led only 7-0 late in the third quarter.

"Excellent teams get frustrated if they don't do well," Grant said after his 152nd career NFL victory in his 18th NFL season. "Excellent teams play hard for two to three quarters in a game while poor teams have to play hard the whole game."

With 3:27 left, Minnesota defensive end Doug Martin scooped up Wendell Tyler's third fumble of the game and raced 29 yards to San Francisco's one-yard line. Two plays later, Alfred Anderson's one-yard dive tied the game, 21-21.

Montana and Roger Craig, who had hooked up for two touchdown passes, connected on a 19-yarder with 6:06 to go as the 49ers took a 21-14 lead.

Vikings quarterback Tommy Kramer shook off a poor start to complete 12 of 25 passes for 191 yards. Montana, who left the game for about five minutes in favor of Matt Cavanaugh because of a slight first-quarter knee injury, completed 25 of 38 passes for 265 yards.

Craig caught seven passes for 72 yards and ran for 78 yards and another touchdown. Tyler added 125 rushing yards for San Francisco, which lost for just the second time in its last 20 regular-season games.

"I think it was just an odd Sunday that we gave up the ball so much," Montana said. "We gave the ball away seven times. You can't expect to win. There are 15 more games ahead of us."

The Vikings tied the game, 14-14, on a 44-yard touchdown pass from Kramer to Mike Jones with 10:20 left. San Francisco had taken a 14-7 lead 1:29 earlier on Montana's 18-yard scoring toss to Craig.

San Francisco led, 7-0, at halftime, as the only touchdown in a mistake-filled half was the result of a fumble. On the game's second play from scrimmage, Kramer fumbled and Dwaine Board recovered on Minnesota's 24-yard line. Montana passed for 14 yards to Craig and, on the next play, Craig swept left for a 10-yard touchdown run.

In the last two meetings between the teams, the 49ers had outscored the Vikings, 99-24. Last year, San Francisco defeated Minnesota, 51-7.

The Vikings finally scored with 1:01 left in the third quarter on Allen Rice's one-yard plunge.