San Francisco 49ers owner Jed York, center, is interviewed by Terry Bradshaw after the NFL NFC Championship football game against the Green Bay Packers Sunday, Jan. 19, 2020, in Santa Clara, Calif. The 49ers won 37-20 to advance to Super Bowl 54 against the Kansas City Chiefs. (AP Photo/Marcio Jose Sanchez)

SANTA CLARA, Calif. (AP) -- When San Francisco 49ers CEO Jed York got rid of his third coach in as many seasons three years ago and faced calls for his removal as well to get the once-proud franchise back on track, he was defiant in face of that criticism.

''You don't dismiss owners,'' York said after firing coach Chip Kelly and general manager Trent Baalke.

Weeks later, the 38-year-old York made the best move since being given control of the team from his parents at the end of the 2008 season. York went out and hired a new management team with Kyle Shanahan taking over as coach and John Lynch as general manager.

The two were given six-year contracts in a sign of York's desire for stability after getting rid of Jim Harbaugh, Jim Tomsula and Kelly as coaches following the three previous seasons and a patient rebuilding process began.

That has led to this season's success that has the Niners (15-3) headed to the seventh Super Bowl in franchise history next week in Miami against the Kansas City Chiefs.

''I try to think every day about banners flying over the stadium (calling) for me to step down from the team. That's always my favorite experience about the 49ers,'' York said Friday.

''I'm happy for our fans. Being in the Super Bowl seven years ago doesn't seem that long, except for the kind of deep valley we went into in between. But I'm so appreciative of them. I'm happy for them that they get a chance to see the team get back to the Super Bowl.''

The rebuilding process wasn't a quick one as the Niners lost their first nine games under Shanahan in 2017 and then went 4-12 the following season.

But the foundation and culture were being built that led to this season's success. The team then added pass rushers Dee Ford and Nick Bosa this past offseason and York believed the pieces were in place for this Super Bowl run.

York likened the process to the movie ''The Shawshank Redemption'' when Andy Dufresne had to crawl through mud to escape prison before ending up on a beach.

''Nobody wants to go through what he went through to get to the beach,'' York said. ''And we had to get through that. And Kyle and John are guys that I know we can get through it with. And we needed to send a message to, first, our team. And, second, our fans, that these guys are here. Not that we knew we weren't going to win games but it was unlikely that we'd come in day one and win the Super Bowl when those guys came here.''

Shanahan saw that commitment when he had a four-hour interview with York three years ago. He wanted to make sure winning the Super Bowl was the most important thing to York before deciding whether to take the job.

He's had no regrets since.

''Everything that he said, he backed up, and you never know until you get somewhere because it's always hard off just an interview and things like that,'' Shanahan said. ''But, since I've been here for three years now, whether we started 0-9 or went 4-12 our second year, that's only gotten stronger, and he's validated that more and more each day.''

York was noncommittal about whether the team would accept a White House invitation if the Niners win the Super Bowl. Going to the White House has gone from a mostly perfunctory honor to a lightning-rod issue after Donald Trump became president in 2017.

The NBA's Golden State Warriors didn't go after winning titles in the 2017 and '18 seasons. The New England Patriots went in 2017 but many players skipped it, including quarterback Tom Brady, who was dealing with family matters. The Eagles didn't go the following year and the Patriots didn't go after winning last season's title.

''We have to get to that point,'' York said. ''For me, personally, I respect the office of the president, and I'm not going to get into politics. I hope that we have that decision to make, and I hope that we have that opportunity, and I hope that we're fortunate enough to get a call from the president to invite us to the White House.''

York has committed to bringing nearly the entire organization to Miami with hundreds of employees from interns on up will come to the game with a guest on multiple charter planes.

''Everyone's been a part of this, and we wanted to make sure they're there to help and also celebrate the moment that hopefully gets us over the hump,'' York said.

---

More AP NFL: https://apnews.com/NFL and https://twitter.com/AP-NFL