* The private firm flirted with bankruptcy in early 2000s
* Sales slipped 8 pct in 2017, after 6 pct growth in 2016
* Lego says figures hurt as it clear high inventories (Adds CEO quotes, detail)
COPENHAGEN, March 6 (Reuters) - Lego's sales fell last year for the first time since 2004 as the Danish toymaker struggled with tough retail markets in Europe and North America, highlighting the challenges facing the new chief executive.
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, compared with 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 that were set high at the beginning of the year in anticipation of growth.
Lego saw "strong double-digit" growth in China, while most established markets in North America and Europe declined. The company will open an office in Dubai this year to help boost sales in the Middle East and Africa.
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.
"We're now aligning ourselves, building the foundation and starting to make investments that will bring us back to growth again. Probably not the type of supernatural growth we had before, but growing in line with the industry," Chief Executive Niels B. Christiansen told Reuters.
The company's Lego Ninjago series benefited from the release of the movie in September. Lego said it was working with Warner Brothers to create the next Lego movie, to be screened in 2019.
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.
But 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.
Christiansen joined Lego in October after nine years as CEO of Danish industrial group Danfoss, taking over from Briton Bali Padda who was in the post for just eight months.
Attempting to fully embrace the digital era, Christiansen said he would invest heavily in products that combine the physical brick with the digital world.
"In the field between the digital and physical, I think Lego has a unique opportunity," he said.
Last year, the company launched Lego Boost which allows children to bring creations to life via simple coding.
Founded in 1932 by Ole Kirk Kristiansen, his grandson Kjeld Kirk Kristiansen is now the main family representative at Lego and ranked last year by Forbes as the 35th wealthiest person in the world with a net worth of $21.1 billion.
($1 = 6.0347 Danish crowns) (Reporting by Jacob Gronholt-Pedersen; Editing by Mark Potter and Edmund Blair)