"He gave his letter of resignation this afternoon and expects the government to ensure his security because he was the main figure responsible for crushing Tamil Tigers," the source close to him said.
Fonseka, 58, the country's only four-star general, has been at loggerheads with the government in recent months after he was removed as army chief and made chief of defence staff, which has no command responsibilities.
There was no immediate word from the government.
Fonseka declared during a visit to the US last month that he was willing to shed his uniform and take up "social work" if politicians did not take advantage of the end of the conflict to ensure economic revival.
The source said he had asked for his resignation to be effective from December 1.
Sri Lanka is set for parliamentary and presidential elections before April 2010.
The government announced it would bring forward the presidential election in a move to gain from strong public support after its defeat of the Tamil Tigers in May.