The highly-rated France striker had indicated he might be prepared to leave the Reebok Stadium.
Bolton chalked up their first win of the season at the weekend by beating Reading with Anelka making it three goals in four games.
He said: "I seem to have been linked with every club in the country of late but my heart is with Bolton.
"I am very happy with my form, the club and the manager so signing a new contract was not a difficult decision.
"Hopefully we will prosper together because I would not have remained at Bolton if I had thought we could not win trophies."
Anelka's decision is a marvellous boost for manager Sammy Lee ahead of the home game against Everton on Saturday.
Lee said: "We have worked tirelessly behind the scenes to get him to commit his long-term future to us.
"Nicolas is one of the world's best strikers and I am immensely proud and happy that he has shown such commitment to the club.
"It is also a boost for the dressing room because a team never wants to lose anybody of Nicolas's stature and presence."
Lee added: "This shows our ambition to be among the top clubs, not just in this country but across the world.
"Nicolas is one of the most sought after strikers in the world and I am delighted that he will continue to wear the Bolton shirt."