By Alan Baldwin

MONZA, Italy (Reuters) - Felipe Massa, the Brazilian who almost won the Formula One championship for Ferrari in 2008 before Lewis Hamilton snatched it away at the last corner of the final race, is to retire at the end of the season.

The 35-year-old Williams driver, who won 11 grands prix for Ferrari between 2006 and 2008, is out of contract at the end of the year and said he had decided some months ago that this season would be his last.

"After 15 years in Formula One... this will be my last," Massa told reporters at the Italian Grand Prix, saying he was more nervous about making the announcement than he had been before any of his races.

"The last eight races in Formula One I will really enjoy as much as I can."

The season-ending Abu Dhabi Grand Prix will be Massa's 250th F1 start, and his departure will open a desirable vacancy at a Mercedes-powered team.

Britain's 2009 world champion Jenson Button, 36, of under-performing McLaren, has been linked with the seat although he has yet to decide whether he will continue.

Massa, who survived a near-fatal head injury in Hungary in 2009 when he was hit on the helmet by a bouncing spring shed from compatriot Rubens Barrichello's Brawn car, joined former champions Williams from Ferrari in 2014.

Although he denied that accident had affected his performance, and could remember little about it after emerging from a coma, the Brazilian has not come close to winning since.

DYING SECONDS

Massa's career high, and low, was winning the 2008 Brazilian Grand Prix and having the title in his grasp until Hamilton, racing for McLaren, took fifth place in the dying seconds to beat him by a single point.

His dignified response earned him even more fans in the paddock and beyond.

The second longest serving Ferrari driver of all time, after former team mate Michael Schumacher, Massa took three podium places and a pole position in his first season with Williams, helping the team finish third overall.

He also had two top three placings last year.

"I chose this place (to make the announcement) because 10 years ago Michael announced here that he was retiring," said Massa.

"He chose to stop to give me the opportunity... and here is almost my second country and it is a very important place to do this."

Schumacher's 2006 retirement announcement gave Massa the chance to stay at Ferrari who had already contracted Finland's Kimi Raikkonen for 2007.

Addressing his future, Massa indicated he was likely to race in another championship.

"I managed to achieve many dreams and I am very proud of my career," he said. "I achieved a lot more than I expected."

(Editing by Tony Jimenez)