Lego is set to ditch a 50-year relationship with Shell after coming under intense pressure over the oil giant's drilling in the Arctic.
A Greenpeace video criticizing the marketing deal went viral, and the environmental activists staged several public protests.
Shell (RDSA) has been working with Lego since the 1960s, allowing its logo to be used on bricks and figures. Lego products are sold in Shell gas stations around the world.
Lego won't renew the contract when it expires. Neither company would comment on how much longer the existing deal has to run.
Greenpeace's YouTube video was seen by nearly 6 million people. It showed Lego figures and bricks in a pristine Arctic landscape being enveloped by an oil spill.
The soundtrack for the video was a mournful version of the 'Everything is awesome' theme song from the popular Lego Movie.
Greenpeace said one million people signed a petition urging Lego to cut ties with Shell during its three-month campaign.
It described Lego's decision as "a huge blow to Shell's strategy of partnering with beloved brands to clean up its dirty image as an Arctic oil driller."
Lego originally resisted ending the deal, saying Greenpeace should take up its concerns directly with the oil company.
Earlier this year, Lego became the biggest toymaker in the world based on revenue and profit.
The family-owned business surpassed top competitor, Mattel (MAT), which is struggling with slumping global sales and slower demand for Barbie dolls and Fisher-Price toys.