(adds CEO quote, background)
COPENHAGEN, March 6 (Reuters) - Lego's sales fell last year for the first time since 2004 as the Danish toymaker cleared excess inventories and struggled with tough retail markets in Europe and North America.
The privately-owned company, famous for its colourful plastic bricks, could be facing its biggest test since flirting with bankruptcy in the early 2000s after a sudden halt to more than a decade of strong growth.
Sales fell 8 percent to 35 billion Danish crowns ($5.8 billion) in 2017, down from a 6 percent increase in 2016 and a far cry from the 25 percent growth achieved in 2015.
The company said overall consumer sales were flat, but the figures were affected by a clean-up of inventories.
Lego saw "strong double-digit" growth in China, while most established markets in North America and Europe declined.
Lego said in September it would lay off 8 percent of staff and that it had pressed the "reset-button", acknowledging its business had grown too complicated.
"During 2017, revenue in our established markets declined, primarily due to actions we took to clean up inventories. This decline impacted our operating profits," Chief Executive Niels B. Christiansen said in a statement.
The company's Lego Ninjago series benefited from the release of the movie in September.
Christiansen said consumer sales grew in seven of Lego's 12 largest markets in December and that the company started 2018 in a better position.
"There is no quick-fix and it will take some time to achieve longer-term growth," he said.
Christiansen joined Lego in October after nine years as CEO of Danish industrial group Danfoss, taking over from Briton Bali Padda after just eight months.
Lego is hoping Christiansen can revive its flagging growth by increasing sales in Asia and fully embracing the digital era.
Toy makers including Mattel and Hasbro have been hit by the bankruptcy of the biggest U.S. toy-store chain Toys'R'Us in September.
Mattel saw sales slip 11 percent last year, while Hasbro grew sales slightly.
($1 = 6.0347 Danish crowns) (Reporting by Jacob Gronholt-Pedersen; Editing by Louise Heavens and Mark Potter)