5:16 AM ET

Shaw resigned after 12 seasons at the school.

Shaw decided to step down immediately after Saturday night's 36-25 loss to BYU.

Shaw said that he thought about it while praying. It was in my head all the time. It's time is the phrase that kept coming to me.

Shaw said he has no desire to coach another team at this point in time, and that he had not considered resigning until this past week.

He said he was not burned out. I feel great. It is a long time. Everybody catches up to you after 16 years of being responsible for everything.

Shaw stepped down as the winningest head coach in the history of the school. He resigned after back-to-back 3-9 seasons and a stretch of 14-28 games.

Two losses to rival California have led to a 3-16 record in the past two seasons for the Cardinal.

A lot of people think the program is not going well. Shaw finished with a 96-54 record at the school. I look at what's inside. I look at the people here, the support that I'm hearing from our athletic director, the people that are behind the scenes. We aren't that far away.

The athletic director thanked David for his contributions to the school. David was both a player and a coach for the Cardinal. Each and every student-athletes in his program has been cared for by him. David is an important part of the history of the program and will remain so for the rest of his life. I would like Cardinal fans everywhere to join me in thanking David and his family for their years of service and wishing them well in their next chapter.

Shaw was a wide receiver for the Cardinal from 1991 to 1994. After Jim Harbaugh left for the football team, he was promoted to the head coaching job.

Shaw succeeded quickly. During his first four years at the helm of the Cardinal, he led them to three Rose Bowls, two victories, and three Pac-12 titles.

Shaw did not acknowledge that was a reason for his departure, even though he expressed how difficult the new college football landscape has been for the Cardinal.

He said thatStanford doesn't change quickly. They are methodical. It has been hard for everyone.

Shaw said the transfer portal would be very attractive to current players. Shaw said yes when asked if he thinks it can return to the level it was before he took the job.

Shaw was asked what it would take to bounce back. It isn't going to be immediately.

The school said it will start a national search for a new coach.

The AP information was used.