In addition, it will pull out of the clothing and publishing businesses.
"We know what went wrong and we know what to do with it," said company director Kjeld Kirk Kristiansen.
Getting into these businesses was a mistake and it contributed to Lego losing its direction, the company said.
"We lost focus," said Poul Ploughmann, executive vice president.
Electronic future
Lego, which is one of the world's 10 largest toy companies, will focus more on the electronic toys market in response to a change in children's tastes.
And it will introduce its basic brick and toy-parts concept to the universe of information technology.
As part of these efforts, the Danish firm has teamed up with Microsoft to develop Lego products to work with the US firm's forthcoming Xbox games console.
It will also produce an interactive CD-rom series based on the Harry Potter stories, in a deal with Warner Brothers Consumer Products.
The two firms have worked together before on a CD-rom series based on Star Wars.
In a separate deal with Universal Studios, Lego will create toys based on the film Jurassic Park III by Steven Spielberg.
Theme parks
Lego will push on with the launch of a new theme park in Gunzburg in Germany next year, its fourth.
But it has put the launch of a fifth theme park on hold because its parks near London and San Diego have drained cash from the company's coffers.
Lego also has a theme park in Billund in Denmark.
Previous losses
Lego made its first ever loss in 1999 when it ended the year 48.50m euros in the red.
Its response at the time was to slash its 10,000 strong workforce by 10%.
That was not enough; in 2000 Lego's losses more than doubled.
But in 2001, the company expects to climb back into the black.