SANTA CLARA, Calif. - Jim Harbaugh, in the signature outfit of khaki slacks and black pullover that has been his uniform the past four years, hustled off the field leading the way all by himself with the game ball cradled in his arms.

He gathered his team to announce he was leaving, but didn't tell the players where he's going next. After three straight trips to the NFC championship game and a Super Bowl near miss, Harbaugh and the Niners agreed to part ways following four seasons and the disappointment of a down year that began with Super Bowl hopes.

Harbaugh will not fulfil the final season of his $25 million, five-year contract coaching the 49ers that he signed in January 2011. The announcement came after Sunday's 20-17 win over the Arizona Cardinals that left the Niners at 8-8.

"It's been the time of my life," Harbaugh said. "Been a lot of great memories, great moments. ... It's been a tremendous four years, it's been a pleasure to work and serve for this organization. I feel great about what we accomplished."

Before he said his final goodbyes with hugs, handshakes and high-fives — even a greeting from Alex Rodriguez — there was one final "Who's got it better than us? No-body!"

"The last, 'Who's got it better than us?' I said it as loud as I could," said wide receiver Michael Crabtree, who could soon follow the San Francisco coach's departure.

Colin Kaepernick, the quarterback Harbaugh promoted in November 2012, threw a go-ahead 3-yard touchdown pass to Bruce Miller late in the third quarter and Frank Gore capped another 1,000-yard season with 144 yards on 25 carries.

Anquan Boldin caught a 76-yard TD pass and went over 1,000 yards receiving. Gore reached 1,000 yards rushing for the eighth time in 10 NFL seasons with the 49ers. The franchise's all-time rushing leader hopes to return to the only team he has known and the team has publicly expressed a mutual interest.

Here are some other things we learned from Sunday's first-year finale at $1.3 billion Levi's Stadium:

ARIANS' MESSAGE: Coach Bruce Arians was clear to his team: "I don't want anybody moping on the plane."

The No. 5 seed Cardinals (11-5) missed the franchise's first 12-win season and the NFC West title as defending Super Bowl champion Seattle beat St. Louis 20-6 to win the division and the overall top seed.

The Cardinals play at Carolina next Saturday, and Arians has been optimistic quarterback Drew Stanton will be back next week from a sprained right knee that got infected.

"It is about short-term memory right now. What we did before doesn't matter anymore, win or lose," linebacker Kevin Minter said. "It is time to just kick it into another gear. This is my first time in the playoffs. I have heard it is a whole other beast."

LINDLEY'S LESSON: Ryan Lindley finally threw his first touchdown pass on his 229th career attempt with a 20-yard strike to Michael Floyd. He did a lot right Sunday, but made some costly mistakes, too.

Lindley completed touchdown passes of 20 and 41 yards to Michael Floyd in the first half, then threw a late interception on a last-ditch drive in the closing minutes.

"I felt the most comfortable I've felt out on the field probably since I've been in the NFL," he said. "But there's still a handful of plays that kill you."

Floyd finished with eight catches for 153 yards. Arians went with Lindley under centre after he originally planned to start rookie Logan Thomas before changing his mind.

GORE'S GAINS: With his sons and family members in attendance, franchise rushing leader Gore provided a bright spot. He became the 11th player in NFL history with eight 1,000-yard seasons and 20th player to reach 11,000 yards rushing.

"It's a blessing," Gore said, noting he has been emotional about his future. "I just wanted to finish it right. ... I cried today because when I first got here I was 21, 10 years ... Knowing this could be my last game here, it's tough because this is all I knew."

BOLDIN'S BIG DAY: Facing his former team, Anquan Boldin caught a 76-yard touchdown pass from Kaepernick in the first quarter for the second-longest catch of his career.

Boldin became the fourth player in 49ers franchise history with multiple 1,000-yard receiving seasons, joining Jerry Rice (12), Terrell Owens (5) and John Taylor (2).

He also caught a 9-yard touchdown pass that was negated by rookie centre Marcus Martin's chop block penalty.

SMITH'S FINALE?: 49ers defensive end Justin Smith might be done after a 14-year career.

Smith wasn't available after the game, but has said recently he would make a decision after the season.

"I'm still going to be upset about the year but I'm excited for Justin Smith and any other guy that might not be here next year," linebacker Dan Skuta said. "I'm excited they got to go out on a win. Might be Justin's last game ever."

___

AP NFL websites: http://www.pro32.ap.org and http://www.twitter.com/AP_NFL