Shearer, 71, had performed on the The Simpsons since it was just a cartoon short on The Tracey Ullman Show.
The comedian confirmed his departure on Wednesday, tweeting a message he attributed to a lawyer for the show's executive producer.
"From James L. Brooks' lawyer: 'Show will go on,Harry will not be part of it, wish him the best,'" Shearer tweeted.
In a subsequent tweet, he explained that his departure was "because I wanted what we've always had: the freedom to do other work."
Characters to live on
The Simpsons showrunner, Al Jean, told New York Times reporter Dave Itzkoff that Shearer's characters will go on without him.
"We do not plan to kill off characters like Burns and Flanders," Jean said in a statement, "but [we] will recast with the finest voiceover talent available."
Some fans were so outraged they called for the end of the show.
This is not the first time the network has clashed with cast members over contracts.
Fox threatened to cancel the satirical sitcom in 2011 if the show's lead actors wouldn't accept a pay cut.
At issue were the salaries paid to Shearer, Dan Castellaneta (Homer, Grampa Simpson, Krusty the Clown, and others), Julie Kavner (Marge Simpson and others), Nancy Cartwright (Bart and others), Yeardley Smith (Lisa) and Hank Azaria (Moe, Chief Wiggum and Apu).
At the time, Shearer said he was willing to cut his salary by 70 per cent to keep the show going, but wanted a share in the production's long-term profits, estimated to be worth billions.
Terms of the deal that saved the show were not revealed.
Shearer isn't the first cast member to leave over his contract.
Maggie Roswell, who played Maude Flanders and Helen Lovejoy, among others, quit the show in 1999 after producers wouldn't giver her a raise.
Her departure resulted in writers killing off Maude, the devout Christian wife of Ned and mother to Rod and Todd, with a T-shirt cannon.
Roswell eventually returned in 2002 after reaching an agreement with Fox.
The 2013 death of Marcia Wallace, who voiced world-weary teacher Edna Krabappel, forced producers to retire the signature character.
Sam Simon, the show's co-creator, died in March after a battle with colon cancer. He was 59.Suggest a correction