The article below originally appeared on SF Gate and is being reprinted with permission.

Tom Martinez

Football coach, Tom Martinez, right, who has worked with such quarterbacks as Super Bowl winner Tom Brady instructs high school students during his football/quarterback camp at Woodside High in Woodside, Calif. on Saturday, June 25, 2011. Kat Wade / Special to the Chronicle

Longtime quarterback guru Tom Martinez died Tuesday after a heart attack during a kidney-dialysis session in Redwood City on his 67th birthday.

The former College of San Mateo football coach was known nationally as the mentor of New England Patriots quarterback Tom Brady, going back two decades to the days when Brady was 13 in San Mateo. Mr. Martinez had flown to New England to work with Brady before the 2011 season began; Brady finished the regular season with the second-most passing yards (5,235) in NFL history and made his fifth Super Bowl appearance.

Given two weeks to live in June, Mr. Martinez, fighting Type 2 diabetes and kidney issues, improved and was on a kidney-transplant list at the time of his death. He was set to enroll in a program at Johns Hopkins in Baltimore.

The Chronicle talked to Mr. Martinez before the Super Bowl, and the dialysis was wearing on him. He still was excited to watch Brady go against the Giants in a game the Patriots would lose.

“It’s been a great ride and I have always enjoyed working with him and watching him play,” Mr. Martinez said.

Mr. Martinez coached at CSM for 32 years, with more than 1,100 wins in football, basketball and softball, a California community college record.

He retired in 2007 but still taught quarterback skills to children throughout the country – last year was the 33rd of his annual camps on the Peninsula – until his health took a turn for the worse.

Mr. Martinez would tell the kids about a nervous 13-year-old he taught a long time ago who listened to him, worked hard and became one of the best quarterbacks in the history of the NFL.

“He taught me how to throw the football at a young age,” Brady told reporters before the Super Bowl. “I’m forever indebted to him. We’ve worked together for over 20 years trying to work on my mechanics and nail those down. He’s had a great commitment to me.

“I owe so much to him. I love him.”

Vittorio Tafur is a San Francisco Chronicle staff writer.