(CNN) -- Ferrari's Felipe Massa claimed a wire-to-wire win in the European Grand Prix on Valencia's street circuit for his fourth F1 victory of the season, finishing ahead of championship leader Lewis Hamilton.
Ferrari's Massa won the European Grand prix but was fined and cautioned for a pitlane infringement afterwards.
Massa easily held onto his lead after starting from pole position and ended 5.6 seconds ahead of Hamilton's McLaren on the 5.4 kilometer (3.4 mile) track on Sunday. BMW Sauber's Robert Kubica was third.
Brazilian Massa was later involved in an inquiry after Ferrari released him early from his second pit stop.
He was given a caution and a 10,000 euros ($14,700) fine.
He was punished for pulling out and running alongside Adrian Sutil's Force India car before giving way at a wall.
Massa thought he was harshly treated.
"I don't think it is me who did anything wrong," he said.
"They should have been investigating Adrian. I was the race leader and he was lapped so he should have given way to me anyway.
"There was nothing for him to gain because he would let me go by on the track, so it was unnecessary in the pit lane."
Race stewards said Massa was guilty of breaching a sporting regulation by his unsafe release from a pit stop, even if he gained no sporting advantage.
Massa's win enabled him to wipe out the memory of his disastrous exit from the Hungarian Grand Prix three weeks ago.
He led comfortably with three laps left in Hungary but his Ferrari engine blew up.
Massa moved into second place in the championship standings with 64.
Hamilton, who kept the lead with 70 points, said he had been close to pulling out because of flu symptoms and severe neck spasms.
"I had to have injections for my neck and luckily I have got a great doctor and a great team or I might not have made it," he said.
"As it was, it was pretty tough in the race and I had a lot of pain. But I don't think I lost any time in the race because of it - I never lose time!"
Hamilton said it was "touch and go" and that the team had reserve and test driver Spaniard Pedro de la Rosa on standby to replace him.
"I have had a miserable weekend really from the day I arrived - I have a lot of flu symptoms, a fever every day.
"I have had low energy, just felt poorly with problems with the spasms in my neck which led to me being in doubt for the weekend and obviously for this race."
He said that "there just isn't enough (drinking) water inside the car and it has been hot all the time. We are inside the cars, in these suits and it is like driving in a sauna."
Hamilton said he did not think his neck problem would cause him trouble at the next race, the Belgian Grand Prix.
Defending champion Kimi Raikkonen of Ferrari retired from the race on the 45th lap after smoke started coming from the back of his car while he trailed in sixth place.