Arlen Specter, who in 30 years representing Pennsylvania in the Senate offended Republicans and Democrats in almost equal measures with maverick votes and a frank cockiness that finally ended his career in politics, died Sunday at his home in Philadelphia. He was 82.

His death was confirmed by his former campaign manager, Chris Nicholas.

Specter, who had a number of major illnesses in recent years, including non-Hodgkin’s lymphoma, was a hard-driving former prosecutor described even by some admirers as sarcastic, rough-hewn, demanding and abrasive. But he stood well above many of his Senate colleagues in his combination of intelligence and effectiveness.

His career in public life began as an influential young investigator of the assassination of President John F. Kennedy and essentially ended with a crucial vote for President Barack Obama’s economic stimulus plan. His biggest mark, however, was made on nominations to the U.S. Supreme Court as a member and briefly chairman of the Senate’s Judiciary Committee.

He provided the coup de grace that finally killed the nomination of his own party’s conservative darling, Robert Bork, in 1987 and, in penance, wielded the sword that won narrow confirmation for conservative hero Clarence Thomas in 1991 by attacking the credibility of Thomas’ accuser, law professor Anita Hill.

Specter won no lasting gratitude from either liberals or conservatives in the process, and he especially alienated women with his attacks on Hill. His lurching from side to side, from vote to vote, from primary to general elections, and the increasing conservatism of his adopted Republican Party, finally caught up with him in 2010.

After yet another “betrayal” of Republicans on the 2009 stimulus plan, he was forced to make the most dramatic leap in a career that was full of them. But this time he did not make it across the chasm.

Facing defeat in the 2010 Republican primary election, Specter surprised the nation by announcing in April 2009 that he was switching parties — for a second time. (In 1965 he switched from Democrat to Republican after winning election as Philadelphia district attorney on the Republican ticket in an end-run around the city’s Democratic machine.)

His Senate change delivered a veto-proof majority there to Obama, but not for long. Pennsylvania Democrats, many of whom had voted against him for years, refused to accept his final conversion, particularly after he said in his characteristically frank way that “my change in party will enable me to get re-elected.” He avoided the Republican primary but lost the Democratic primary.

Specter, who passionately played the elite game of squash most of his life after picking it up as an undergraduate at the University of Pennsylvania, was born Feb. 12, 1930, in Wichita, Kan., the son of a peddler and junkyard owner, and raised in the only Jewish family in Russell, Kan.

After graduating Phi Beta Kappa from Penn in 1951 with a bachelor’s degree in international relations, he served in the Air Force. In 1953, he married the former Joan Levy. She survives him, along with their sons Shanin and Stephen, and four grandchildren.

He graduated from Yale Law School in 1956 and later went to work for the Warren Commission, where he is credited with developing the “single-bullet theory” which helped the commission conclude that a lone assassin had killed Kennedy in 1963.

In two terms as district attorney in Philadelphia in the 1960s, he made a name for himself by bringing corruption cases but also scored political points by prosecuting unpopular Penn students during the student turmoil of the day. In Pennsylvania he lost races for Philadelphia mayor, governor, senate and reelection as district attorney before finally winning his Senate seat in 1980. He would hold it longer than any other Pennsylvanian. He ran for the presidency in 1996.

Specter wielded an influential swing vote in the Senate. But he particularly distinguished himself, for better or sometimes worse, during his 14 Supreme Court confirmation hearings, when he habitually asked probing questions of nominees from both parties instead of succumbing to the rhetorical approach favored by his colleagues.

Specter’s extended questioning of Bork, a brilliant but, for his time, one of the most radically conservative nominees to come before the committee, is remembered as an exhilarating constitutional exchange on fundamental issues such as free speech, equal protection of the laws, and the “original intent” of the authors of the Constitution.

Bork’s nomination was in some trouble before Specter announced he would oppose the President Ronald Reagan’s nominee, but as a Republican and the committee’s most respected legal intellect, the decision was devastating. Specter, always a champion of civil rights, said he could not trust Bork to adhere to the 14th Amendment’s guarantee of equal protection.

When Clarence Thomas was nominated by George W. Bush four years later, Specter was fearful of a bitter primary campaign centering on the backlash to his Bork vote. While Thomas was in many ways as conservative as Bork, including on equal protection issues, Specter supported him.

After Thomas’ hearing, Newsday and National Public Radio revealed that the nominee had been accused of sexual harassment by Anita Hill. Another round of hearings was scheduled. The White House, cognizant of Specter’s skill in cross examination and especially the tight spot he was in politically, asked Specter to lead the questioning of Hill. Specter, the loose cannon for Republicans, had been co-opted.

Specter, after assuring Hill that he did not consider the proceedings to be adversarial, proceeded to attack her with his toughest prosecutorial demeanor, challenging her with a staccato burst of alleged inconsistencies and blindsiding the staid University of Oklahoma law professor with bizarre allegations of psychological issues in her relationships with men. Even some of his more conservative Republican colleagues had urged him to stay away from that material. When he questioned Thomas later in the day, Specter shook the room by announcing that “it is my legal judgment” that Hill was guilty of “flat-out perjury.”

Many of Specter’s liberal and/or female supporters were repulsed by what they saw that day, and he was very nearly defeated in the next year’s general election by a woman who campaigned on his treatment of Hill.

Even so, some of Hill’s closest supporters in those hearings forgave Specter.

“I have the utmost respect for Arlen Specter,” said Charles Ogletree, the liberal Harvard law professor who helped lead Hill’s legal team at the hearings. After a period of mutual enmity after the Hill hearings, “We’ve become the best of friends.” Ogletree said that Specter had “very progressive views on judicial appointments.”

What’s more, though Hill herself is still concerned by Specter’s “stinging cross examination,” Ogletree said Hill and Specter have “exchanged words” and “put the past behind them.” Hill did not return a message asking her to comment.

But certainly not everyone in the Hill camp was conciliatory.

“I can never forgive him for what he did to Anita Hill,” said Nan Aron, the head of the liberal legal group “Alliance for Justice” and one of the first in the Thomas opposition to hear of Hill. “That’s unforgivable.” While Specter tried to “make amends with people, including me,” her view is that Specter was in the end “the consummate pol who wanted more than anything else to serve in that institution.”

While Thomas and Bork overshadowed his Senate career, Specter, at least compared with other Republicans, was a champion of civil rights, women’s rights, some gay rights, and education. He said in 2004 that he would oppose judicial nominees who would end the right to an abortion. That comment almost cost him his cherished chairmanship of the Judiciary Committee in 2005, but he agreed to toe the line on Republican nominees, which he did for two years until Republicans lost the Senate. “Nine lives? I think I have 19,” Specter said of that latest escape.

He also chaired the Senate Select Committee on Intelligence and the Senate Committee on Veterans Affairs.

His vote in 1999 on the impeachment of President Bill Clinton was pure Specter. Every other senator voted guilty or not guilty. Specter, invoking Scottish law, voted “Not proven, therefore not guilty.”