Shanghai confirmed the signing on Wednesday, and Drogba said on his website he will join the Chinese Super League team in the country's financial hub next month.
No details were given on Shanghai's offer, although local media reported the club was willing to pay as much as $15 million per year.
"I studied all the offers I've received in recent weeks and I feel that going to Shanghai Shenhua is the right direction for me now. I'm looking forward to this new challenge, to discover a new culture and I am very enthusiastic about the development of the Chinese football league," Drogba said in his online statement.
On its website adorned with pictures of Drogba against a background of Shanghai skyscrapers, the club lauded the 34-year-old former Chelsea striker as the most dominant player ever to join a CSL team.
"You can see from the online response, the fans are crazy about him," Shanghai spokesman Ma Yue told The Associated Press.
"There has never been a foreign player who has stirred up such a reaction in China. It means a lot to Chinese football and will be of immense help in spreading the CSL brand."
The announcement comes days after a reported visit to Drogba's native Ivory Coast by Shanghai's owner, Zhu Jun, an online gaming magnate whose fortune has already facilitated the hiring of former Argentina coach Sergio Batista and another former Chelsea player, Nicolas Anelka.
On his Twitter feed, Manchester United defender Rio Ferdinand said he looked forward to playing against Drogba when they travel to Shanghai on July 25.
Drogba's move to Shanghai had been speculated for months. He was also approached by Al Wasl of the United Arab Emirates, coached by Diego Maradona, but its bid was believed to be less than Shanghai's.
Drogba capped his Chelsea career by scoring the equalizing goal and then the penalty shootout winner in Chelsea's win over Bayern Munich in last month's European Champions League final.
Prior to his nine years at Chelsea, he had spells at French clubs LeMans, Guingamp and Marseille.
Chinese club football has long been dogged by mismanagement and corruption, with the level of performance trailing well behind that of neighbors South Korea and Japan. But rapidly escalating salaries are beginning to attract big-name players while authorities have ramped up measures to stamp out fixing.
Shangahi sits in 12th place in the 16-team Chinese Super League, 15 points behind leader Guangzhou Evergrande, which itself broke the Chinese transfer spending record to sign Argentine playmaker Dario Conca for $10 million from Fluminense, reportedly making him the third-highest paid player in the world.
Guangzhou followed that up by hiring coach Marcello Lippi, who guided Italy to the 2006 World Cup title and Juventus to the 1996 Champions League crown and five Serie A championships.
China's football association hopes the big names will in turn boost sponsorship and give the Chinese league wider recognition, although a lack of homegrown talent remains a problem for the perennially underperforming national team.