The San Francisco 49ers earned the final NFC wild-card playoff berth today with a come-from-behind 31-16 victory over the Dallas Cowboys before 60,114 at Candlestick Park, ending the playoff hopes of the Washington Redskins.

The 49ers will meet the New York Giants in the NFC wild-card game Sunday at Giants Stadium. The 49ers and the Redskins both finished 10-6, but San Francisco beat out Washington for the final berth because it defeated the Redskins, 35-8, on Dec. 1 at RFK Stadium.

Dallas (10-6) already had won the NFC Eastern Division title and will play the NFC West champion Los Angeles Rams in two weeks in a conference semifinal game in Anaheim, Calif.

"Nothing was riding on this game except the home field advantage if the Rams lost (Monday night against the Raiders)," said Dallas Coach Tom Landry. "That's not much incentive against the world champions."

San Francisco came from behind today and won on two Joe Montana-to-Dwight Clark touchdown passes and touchdown runs by Jerry Rice and Roger Craig, who became the first player in NFL history to gain 1,000 yards rushing and 1,000 receiving in a season.

The Cowboys will use their extra time off to rest some of their wounded, especially quarterback Danny White, who spent the cool (for California) afternoon in slacks and a sweater.

Gary Hogeboom directed the Cowboys, and, in the first half at least, did much to brighten the spirits of Redskins rooters as he led Dallas to a 16-10 halftime lead.

The Cowboys led, 7-0, after they drove 86 yards in 12 plays in the game's first possession, with Hogeboom hitting tight end Doug Cosbie on a one-yard touchdown pass.

A short 49ers punt set up the Cowboys' next score. Rafael Septien kicked the first of three field goals, from 29 yards, for a 10-0 lead with 11:56 left in the second quarter. Four minutes later, Septien made it 13-0 with a 48-yard boot.

Hogeboom would finish the day completing 28 for 49 passes for 389 yards and one touchdown. But he also had two key interceptions and a sore left shoulder after being sacked six times and pressured countless more.

"In the first half, it was us getting all the key plays," Hogebom said. "In the second half, it was the 49ers. Their blitzes really kept me on my toes, and by the number of times I was sacked you could see that I didn't always pick them up correctly."

Actually, the 49ers started making the big plays late in the second quarter, and they later would build on them.

In the second quarter, Tony Dorsett fumbled after catching a pass inside the 49ers' 20-yard line and Montana took four plays to move the 49ers to the Dallas 49. Then Montana and Clark got conerback Victor Scott to turn the wrong way on a post pattern. Clark caught Montana's pass in stride to cut the Dallas lead to 13-7 with 3:54 left in the half.

"I think he was playing man to man," said Clark, "and it's tough to cover that if Joe has that much time."

Montana did have time. And after Septien's third field goal made it 16-7, Montana gave a decent clinic in the 32-second drill.

Starting at his 31 with two timeouts, Montana moved the 49ers to the Dallas 21. There, on the final play of the half, Ray Wersching kicked a 39-yard field goal to cut the Dallas lead to 16-10.

Said Dorsett, who finished with just 49 yards in 19 carries, "There was not a whole lot at stake. We took control and thought we had it made. But we got a little lackadaisical and lost our concentration."

The Cowboys' first possession of the third quarter set up the 49ers' first lead of the game. Hogeboom completed an 18-yard pass to rookie Karl Powe (seven catches for 127 yards), who was replacing Tony Hill (hamstring pull). After a completion to Dorsett, Hogeboom tried to hit Cosbie, but the pass was intercepted by cornerback Dwight Hicks, who returned the ball to the Dallas 44.

The ensuing seven-play 49ers drive involved two passes to tight end Russ Francis and five runs by Craig, the last of which came from four yards out on a pitch and allowed San Francisco to take a 17-16 lead.

The 49ers made it 24-16 when Rice, a receiver, scored on a 15-yard reverse with 22 seconds left in the third quarter. Rice, who has started most of the second half of the season after supplanting Freddie Solomon, came off the bench today. Solomon announced Friday that he would retire after this season, so Coach Bill Walsh let him start at receiver and play quarterback on the game's final play.

With nine minutes left in the game, Montana and Clark connected for a 24-yard touchdown pass to make it 31-16. It was a good pass and good catch, but by then the Cowboys -- and thus the Redskins -- were virtually finished.

On its previous possession, Dallas had fourth-and-six inches at 49ers' 28 with 11:37 left in the game and the 49ers holding their 24-16 lead. Fullback Timmy Newsome tried blowing through the middle and got nowhere when he was hit by defensive end John Harty, who was playing in tight. Newsome bounced of the pile, tried to go outside and lost 11 yards.

Said Harty: "They made good plays. We made good plays. We won. They lost."