Something seems off-kilter in Philadelphia, as if a crane had taken the statue of Billy Penn from its place atop City Hall.

After five decades as a towering figure in the public life of his city, state, and nation, Sen. Arlen Specter is in the strange position of counting the days until the likely end of his political career.

Specter, 80, famous as an electoral Houdini, finally found himself in a tight spot he could not escape - standing for election in a year of voter hostility to Washington incumbents. Not even his surprise switch in parties 13 months ago could save him.

What Specter might do next, after his term concludes in early January, is anyone's guess. He has never been predictable.

"He's one of the most complicated people in public life today," said Randall Miller, a political historian at St. Joseph's University. "He defies easy characterization. For that matter, he defies political science. . . . He just doesn't do what you expect him to do."

Starting even before he was elected district attorney of Philadelphia in 1965 until now, Specter has been at the center of much of recent American history.

He will long be remembered for his role, as a young staff attorney to the Warren Commission, in devising the single-bullet theory that is crucial to the conclusion that a single assassin was responsible for killing President John F. Kennedy in 1963.

Specter has had a key voice over the years in shaping the Supreme Court, has boosted federal spending on medical research to combat life-threatening illnesses (he is a two-time cancer survivor), and has brought billions of federal dollars to Pennsylvania.

Specter has served in the Senate longer than anyone in Pennsylvania history, an achievement that might have seemed ludicrous when the then-Republican was losing the 1967 mayor's race, a reelection campaign as district attorney in 1973, a Republican Senate primary to John Heinz in 1976, and the GOP nomination for governor in 1978, to Richard Thornburgh.

In 1980, Specter tried again for statewide office, capturing the Republican nomination for U.S. Senate and then eking out a 2-percentage-point win over Pittsburgh Mayor Peter Flaherty, a Democratic star of the time. Specter visited every one of the state's 67 counties to talk to voters in any hamlet, driving through the summer with his son Shanin, now a prominent Philadelphia trial lawyer, as Flaherty vacationed.

After winning that contest, amid the Ronald Reagan landslide, he went on to win reelection four times.

Specter stayed a moderate Republican in a chamber where that eventually became an endangered species. But after voting last year for President Obama's $787 billion stimulus bill, he saw his approval rating among Republicans drop by 50 percent and concluded he could not be renominated in the face of a primary challenge from former Rep. Pat Toomey.

On April 28, 2009, Specter joined the Democrats, winning the endorsement of Obama, who pledged to do all he could to help the senator win reelection in his new party. Vice President Biden of Delaware, a friend of decades from their years of riding Amtrak together from Washington, played a large role in encouraging Specter to switch.

As a Republican, Specter was often an irritant to his party, especially on social issues such as abortion rights and stem-cell research. He voted with the GOP position 58 percent of the time over his career, according to Congressional Quarterly. That's a high degree of dissent by today's Senate standards.

Specter made his biggest mark as a member of the Senate Judiciary Committee, which he chaired from 2005 to 2007, and he has helped shape the Supreme Court and the entire federal judiciary.

Conservatives still loathe him for killing Reagan's 1987 nomination of appellate Judge Robert Bork for the high court. Specter thought Bork held too narrow a view of civil rights, and he was the most prominent Republican to come out against the nominee.

In 1991, though, Specter helped win confirmation of conservative Justice Clarence Thomas. And the way it happened became one of the enduring and most controversial episodes of his career.

After Anita Hill, a law professor who had earlier worked for Thomas at the Equal Employment Opportunity Commission, accused Thomas of sexual harassment, Specter shredded her on cross-examination before the Judiciary Committee. He concluded that Hill had been guilty of "flat-out perjury" because she made allegations at the confirmation hearings that appeared to contradict her sworn statement to the FBI.

Specter's treatment of Hill enraged millions of women and motivated an election challenge in 1992 by Democrat Lynn Yeakel, who had no political experience. Specter only narrowly defeated her that November.

Some Democrats also have not been able to forgive Specter for shepherding President George W. Bush's nominations of Chief Justice John G. Roberts Jr. and Justice Samuel A. Alito Jr. in 2005. The two have been a conservative bulwark on the court, responsible for the recent decision that corporations have a First Amendment right to spend freely in federal campaigns.

Although Specter has always been a proponent of senators assessing court nominees on their qualifications and of giving deference to the president, he has recently said he erred in believing Roberts' pledge to be a neutral arbiter rather than an activist. He said he would pay attention to nominees' ideological beliefs in future hearings - and will get at least one more chance to do so, with the expected summer confirmation hearings for Elena Kagan.

A master of dealmaking, Specter has been instrumental in increasing spending at the National Institutes of Health from $12 billion a year to $30 billion since 1996. Health has been more than a political issue to him - he has survived two bouts of Hodgkin's lymphoma, a brain tumor, and open-heart surgery.

Specter also has embraced what critics call pork, but what others consider vital federal investments in Pennsylvania. When Citizens Against Government Waste listed him in their "Pig Book" a few years ago, Specter reportedly said: "If they left me out, I'd be worried."

Miller, the St. Joseph's political historian, said that Specter's greatest legacy may be the billions he has brought to the state, for everything from medical clinics to dams and highways to the dredging of the Delaware River to increase shipping to Philadelphia's port.

"Like all great Pennsylvania politicians, he's been a rainmaker," Miller said. "He can point to things he made happen."

And who knows? Perhaps Specter's public body of work is not yet finished.

"You see all the fun I've had? So many historical moments," Specter said in a December interview. "I'm not going to stop. . . . I feel good, and I've got a lot more to do."