Felipe Massa drives during the Brazilian Grand Prix. (Photo: Getty Images)

drives during the Brazilian Grand Prix. (Photo: Getty Images)

Felipe Massa was set for a podium finish in his last race with Ferrari until a drive-through penalty cost him track position at the Brazilian Grand Prix.

Massa finished the season-ending race seventh after starting ninth, but he was running fourth when he was penalized for illegally crossing a pit line near the midway point of the race at his home track of .

Massa said teammate , who was running third and had already secured second in the drivers’ standings, was ready to let him pass for a podium finish in front of the Brazilian crowd.

“I had the pace to stay in fourth place and I certainly had a teammate up front that would have allowed me to overtake him for a podium finish,” Massa said. “It was a pity, the race was going really well.”

Alonso said it was “unfortunate” that Massa couldn’t stay near the front in the end.

“We wanted to help him but he got the drive through penalty,” Alonso said. “It was a shame. The podium was very close for Felipe today. When I saw him fourth I said this would be a very good celebration for him.”

Still in his car, Massa said over the radio that the penalty was absurd.

“Incredible, incredible,” Massa said. “Unacceptable.”

Massa said after the race that he was surprised with the penalty, saying it was the first time he saw it happen at Interlagos.

But replays showed Massa clearly crossed the line marking the pit entrance, which race stewards had previously warned would not be allowed for safety reasons.

Massa waved his hands to complain while driving through the pits to serve the penalty. He had three laps to take the penalty and waited until the last one to come in.

He returned to the track in eight place and wasn’t able to recover.

“It wasn’t the kind of finish I expected,” he said.

Massa drove eight seasons with Ferrari but didn’t have his contracted extended after the end of this year, when he finished eighth in the drivers’ standings. He will be joining Williams in 2014.

Massa was loudly jeered by fans at Interlagos and was applauded by Ferrari team members when he left for the track before the race. Team members were wearing a shirt that said “Thank you, Felipe,” in Portuguese.

The Brazilian competed in 139 races with the Italian team, second most only to seven-time champion Michael Schumacher. Massa won 11 races with Ferrari and finished on the podium 36 times.