Specter's irascible independence caught up with him in 2004. He barely survived a GOP primary challenge from Toomey by 17,000 votes of more than 1.4 million cast. He went on to easily win the general election with the help of organized labor, a traditionally Democratic constituency.
Specter was diagnosed in 2005 with stage IV Hodgkin lymphoma, a cancer of the lymphatic system. Announcing the diagnosis with his trademark doggedness, Specter said: "I have beaten a brain tumor, bypass heart surgery and many tough political opponents and I'm going to beat this, too."
"Arlen Specter was always a fighter," Obama said in a statement Sunday. "From his days stamping out corruption as a prosecutor in Philadelphia to his three decades of service in the Senate, Arlen was fiercely independent — never putting party or ideology ahead of the people he was chosen to serve. He brought that same toughness and determination to his personal struggles."
Specter wrote of his illness in a 2008 book, "Never Give In: Battling Cancer in the Senate," saying he wanted to let others facing similar crises "ought to know they are not alone."
Cancer handed him "a stark look at mortality" and an "added sense of humility," Specter told The Associated Press.
Born in Wichita, Kan., on Feb. 12, 1930, Specter spent summers toiling in his father's junkyard in Russell, Kan., where he knew another future senator — Bob Dole. The junkyard thrived during World War II, allowing Specter's father to send his four children to college.
Specter left Kansas for college in 1947 because the University of Kansas, where his best friends were headed, did not have Jewish fraternities. He graduated from the University of Pennsylvania in 1951 and Yale law school in 1956. He served in the Air Force from 1951 to 1953.
Friends say his childhood circumstances made him determined, tough and independent-minded. Specter considered his father's triumphs the embodiment of the American dream, a fulfillment that friends say drove him to a career in public life.
He entered politics as a Democrat in Philadelphia in the early 1960s, when he was an assistant district attorney who sent six Teamsters officials to jail for union corruption.
Working on the Warren Commission in 1964, Specter was the chief author of the theory that a single bullet had hit both Kennedy and Texas Gov. John Connally, an assumption critical to the conclusion that presidential assassin Lee Harvey Oswald acted alone. The theory remains controversial and was the subject of ridicule in Oliver Stone's 1991 movie "JFK."
After working on the Warren Commission, he returned to Philadelphia and challenged his boss, James Crumlish, for district attorney in 1965. Specter ran as a Republican and was derided by Crumlish as "Benedict Arlen." But Crumlish lost to his protege by 36,000 votes.
Specter lost re-election as district attorney in 1973 and went into private practice. Among his most notorious clients as a private attorney was Ira Einhorn, a Philadelphia counterculture celebrity who killed his girlfriend in 1977.
Finally, in 1980, Specter won the Senate seat vacated by retiring Republican Richard Schweiker, defeating former Pittsburgh Mayor Pete Flaherty.
After leaving the Senate in January 2011, the University of Pennsylvania Law School said Specter would teach a course about Congress' relationship with the Supreme Court, and Maryland Public Television launched a political-affairs show hosted by the former senator.
He also occasionally performed standup comedy at clubs in Philadelphia and New York. He played squash nearly every day into his mid-70s and liked to unwind with a martini or two at night.
A funeral was scheduled for Tuesday in Penn Valley, Pa., and will be open to the public, followed by burial in Huntingdon Valley, Pa.
Specter is survived by his wife, Joan, and two sons, Shanin and Steve, and four granddaughters.