Joe Montana passed for three touchdowns and San Francisco sacked Steve Bartkowski eight times as the 49ers ended a six-game homefield losing streak by beating the Atlanta Falcons, 24-20, today.

But there was bad news for the 49ers: Wendell Tyler, one of the leading rushers in the NFL, went out in the first period with what was initially diagnosed as a dislocated shoulder. He was hurt on a run that gained four yards and helped set up a touchdown.

After the game, San Francisco Coach Bill Walsh said that the injury may not prove to be as serious as first thought and Tyler "may be back next week or he could be out up to three weeks."

Atlanta lost one its offensive stars, wide receiver Alfred Jackson, whose left collarbone was broken later in the first half. In addition, Falcons defensive lineman Mike Zele hurt a knee.

"It was as tough a game physically as we'll have," said Walsh.

Montana's third scoring pass of the game and 10th of the season was a one-yard toss to tight end Earl Cooper early in the fourth quarter. San Francisco had started the drive at its own 29 and took nine plays to reach the end zone.

Bartkowski, who had two touchdown passes in the game, had given the Falcons (2-2) their only lead of the game, 20-17, with a three-yard touchdown run in the opening minute of the final quarter.

After the pass to Cooper, the Falcons had nine minutes to pull the game out, but in their first drive, the San Francisco defense dropped Bartkowski three times.

"The 49ers have a great pass rush. They threw some blitzes at us early that we didn't expect," said Bartkowski, who has been sacked 19 times in four games. "I don't know why their pass rush was so effective."

The 49ers' defense also held the Falcons to 319 yards total offense and recovered a fumble.

The victory for the 49ers (3-1) was their first at Candlestick Park since they beat Dallas in the 1981 NFC title game.

In the first half today, Montana threw scoring passes of 21 and 12 yards to Dwight Clark. In the third period, the 49ers' Ray Wersching kicked a 24-yard field goal.

The 49ers ran the ball 31 times and passed it 32 in a balanced offense that gained a total of 418 yards.

"Our offensive line was excellent, just excellent," said Montana. "We could do about anything we wanted to do."

Montana finished 27 of 32 for 261 yards passing.

"We went more to our short passing game and concentrated our running attack on our fullbacks," Walsh said. "Thus, we were able to control the ball."

Bartkowski, who threw scoring passes of 20 yards to Billy Johnson (near the end of the first half) and 76 yards to Floyd Hodge (on Atlanta's first play of the second half), finished 19 of 23 for 243 yards.

"We were good and bad," Atlanta Coach Dan Henning said. "We had the spunk to come back from 14-0, but we just didn't have enough to come back for the win."