A BART station agent lost his job for giving $300 in tickets to a needy teenager, but the drama appears to have ended on a happier note for the young rider.

Jim Stanek, a 66-year-old Novato resident, learned Tuesday he was fired for giving paid, unused tickets to a 16-year-old boy who was having trouble affording his commute from the East Bay to school in San Francisco. He said he was trying to do a good deed for the grandson of a friend, but the act violated the transit system’s policy.

After reading the story, first reported in mid-April, an East Bay woman contacted the student’s school, the Flex Academy, with a generous offer: She will pay for his transportation until he graduates. He is currently a junior.

Lonnie Gordon, the boy’s grandfather and Stanek’s friend, said the offer includes bus and BART fare to and from school, which adds up to as much as $15 a day. Gordon says the teen needs bus fare when he travels to the Pittsburg/Bay Point BART Station from either his grandparents’ home in Oakley or his mother’s house in El Sobrante. The boy’s father died last year.

Gordon, who along with his wife is retired, said his grandson sporadically participated in the student discount program that BART extends to Flex Academy and other schools. Even with the discount, he said, bus and BART cost at least $9 a day.

“This lady was very nice and kind, we appreciate it,” he said, adding that the donor wishes to stay anonymous.

Still, he said, he wishes the situation leading to his friend’s firing had been different.

“I’ve been sick over this. I can’t help but feel somewhat responsible. I can’t help it,” he said. “If somebody got in trouble for doing something for you, you’d feel the same way.”