(CNN) -- Ferrari's Felipe Massa was declared the winner of the Belgian Grand Prix after McLaren driver Lewis Hamilton, who was first over the finishing line, was given a 25-second penalty for an illegal maneuver and demoted to third.
Massa had been lying third when Hamilton and Raikkonen fought out the finish.

McLaren decided to launch an official complaint with FIA's International Court of Appeal but it was unclear when it would be heard.
"We have no other option," the team said in a statement, adding it would focus first on next Sunday's Italian Grand Prix in Monza.
They could not lodge an immediate appeal against the result because it was officially a drive-through penalty which should have been applied during the race.
Few would argue with Massa's summing up. "This was a very strange race,' he said, after being awarded the victory.
It was his second successive success after his win two weeks ago in Valencia, yet apart from briefly leading during a pit stop, he was never really in contention.
Hamilton had finished in front after dramatically overtaking Ferrari's Kimi Raikkonen in a great tussle over the closing stages as rain made the track treacherous.
Race stewards said Hamilton had cut across a chicane to gain an advantage before passing the defending world champion.
Raikkonen later spun off the track while trying to catch the British driver.
Hamilton was demoted to third place, with BMW Sauber's Nick Heidfeld promoted to second.
Hamilton had already taken the plaudits on the podium when the stewards announced that they were investigating an incident during the desperate struggle between the British driver and Raikkonen in the late stages of the race..
The pair made contact several times while the McLaren driver tried to pass the Ferrari and when the Finn fought back.
Hamilton jumped the Bus Stop chicane before passing Raikkonen at La Source during the scrap and this was to prove his downfall.
He explained that Raikkonen forced him by pushing him wide in the heat of the action and he did not want to crash into his opponent by staying on the track.
"He pushed me wide I had no room. This is motor racing," said Hamilton.
McLaren chief Ron Dennis's first reaction to news of the inquiry was that he was confident that no action would be taken against either of the drivers.
After the punishment McLaren said: "We have studied the details and put them before the FIA stewards.
"They show that after cutting the chicane Lewis lifted off, he was 6km/h slower than Kimi. After conceding the lead to Kimi, Lewis repositioned his car on the right and beat Kimi on the brakes going into the hairpin."
Critics and paddock observers were swift in their condemnation of a decision that reeked of potential favoritism for Ferrari and seemed entirely unjustified following the most exciting race of the year.
Hamilton, starting on pole, lost the lead to Raikkonen with an early spin but fought back in the closing laps regained the lead with two laps to go.
As a soaking track made conditions extremely tricky Hamilton passed Raikkonen, only to fall behind again with a spin. The British McLaren driver again went ahead of the Ferrari and Raikkonen's bid for an important victory ended as he crashed.
In a chaotic final couple of laps, BMW Sauber's Nick Heidfeld jumped from eighth to third following an inspired decision to come in for wet-weather tires at the start of the last lap.
Renault's Fernando Alonso chose the same tactic and it secured the double world champion the fourth place he had held for much of the race.
After rain in the morning, the track was wet in the start and hairpin areas, but dry elsewhere. Rain was forecast making it difficult for teams to formulate race plans.
Most began on soft, dry tires and as Hamilton set off from pole position his team-mate Kovalainen made a disastrous start and fell from third to 13th on the opening lap.
Massa also faltered, running wide, but rejoined on the rush towards Eau Rouge.
Raikkonen was away brilliantly, quickly challenging Massa and taking second place while Alonso went fourth.
Hamilton was soon in trouble, losing control in the wet at the end of the opening lap spinning at La Source hairpin. Raikkonen dashed past him beyond Eau Rouge and up the hill to take the lead.
This left the Finn in front ahead of Hamilton with Massa third and the trio went on to dominate the rest of the race in changing conditions.
Hamilton was unable to stay in close contact and Raikkonen established a clear lead before the opening pit stops after 11 laps.
Hamilton rejoined in seventh place and Raikkonen pitted a lap later, rejoining in third as Massa took the lead for a lap before he too pitted.
By then Nelson Piquet, the only runner to have chosen intermediate tires, had put a tire on a white line and spun off into the barriers in his Renault.
As the midfield positions switched , Raikkonen stayed out on top by more than five seconds until the second stops when they switched to the harder tires.
Hamilton regained the initiative and reduced the Finn's lead to 1.3 seconds in the final sector of the race.
It was a close fight between the front three in terms of lap times as the dark clouds loomed over the forests for the final eight laps.
With six laps remaining, the first rain drops began to fall and produced the conditions that created the amazing final few laps when Hamilton grabbed the lead.
On lap 42, he passed Raikkonen before the rain fell heavily. With three laps remaining the race was turned into a lottery as they both spun but the issue was settled when Raikkonen crashed off into a wall and out of the race.
"I was praying: rain, rain, rain," Hamilton said. "I wanted the rain to come. But it was incredibly tough."
After the change of result Hamilton's lead in the overall standings was trimmed to two points, with 76 to Massa's 74. Robert Kubica is a distant third with 58, one ahead of reigning champion Raikkonen.
Toyota's Timo Glock was also handed a 25-second time penalty by race stewards after ignoring waved yellow flags at one point late in the race.
That deprived the German of his single point, after previously finishing in eighth place, with Red Bull's Mark Webber promoted into the final points-scoring position.