PHILADELPHIA (AP) _ Democrat Harris Wofford, whose political hopes seemed dead just two months ago, pulled off a ''miracle'' win over former Attorney General Dick Thornburgh that sent shock waves to the White House.

Wofford, appointed to the U.S. Senate in May by Gov. Robert P. Casey, easily beat Thornburgh in Tuesday's special election to fill the term of Republican Sen. John Heinz, who died in a plane crash in April.

With 97 percent of 9,428 precincts reporting early today, Wofford had 1,801,718 votes, or 55 percent. Thornburgh, who left the Bush administration to run in a state that had twice elected him governor, had 1,459,299 votes, or 45 percent.

Wofford, in his first bid for political office, trailed Thornburgh in the polls by as much as 40 percent two months ago. Pennsylvania had not elected a Democrat to the U.S. Senate since 1962.

Paul Begala, Wofford's campaign manager, called the win ''a political miracle.''

Wofford aimed his campaign at the middle class, calling for national health insurance and criticizing ''do-nothing Washington insiders.'' The former college president had caught up in the polls by last weekend.

Wofford said his victory shows that Democrats should ''listen to the people and see how they're hurting and have ideas that respond to them.''

''I ... have a mission from the people of Pennsylvania. We want action on our problems in this country,'' Wofford said this morning on NBC's ''Today.'' ''We've rushed overseas with generosity and resources but we haven't dealt with problems of our own.''

President Bush acknowledged this morning that Wofford struck a chord.

''I just take Senator Wofford at his word, that there's a message here for the administration and a message here for the United States Congress,'' Bush said during a news conference in Washington. ''And I think people - when the economy is slow, people are concerned. They're hurting out there.

''They're concerned about their livelihood. He got a big hand for saying he wants to help on those whose benefits have run out. So do I. ...''

Thornburgh said: ''Senator Wofford did a superior job of communicating his concerns to the people of Pennsylvania and I extended my congratulations to him on that and I wish him well.''

''This is absolutely unprecedented in Pennsylvania history. To knock off a major-league player like Dick Thornburgh is absolutely astounding,'' said G. Terry Madonna, director of the Center of Politics and Public Affairs at Millersville University.

''This has the potential of standing national politics on its head,'' said Madonna. ''I suspect Democrats will come out just swinging on the domestic agenda. It could well set the tone and the agenda'' for the 1992 elections.

In his concession speech, Thornburgh told supporters that ''concerns and anxiety about the costs and coverage of health care obviously commanded much greater attention in this campaign then we anticipated.''

Tuesday's results showed Wofford was strong in many traditionally Republican areas, carrying several counties that Thornburgh won in his successful campaigns for governor in 1978 and 1982. Wofford won Allegheny County, Thornburgh's home turf, by nearly 90,000 votes.

Wofford, an adviser to President Kennedy, helped found the Peace Corps but was largely a political unknown in Pennsylvania when Casey appointed him to the Senate last May.

The 65-year-old former state labor secretary wasn't even Casey's first choice, taking the appointment after former Chrysler Chairman Lee Iacocca turned it down.

Thornburgh, 59, emphasized his experience as a former federal prosecutor, and Wofford started gaining on him in mid-September after he began to focus on the national health care issue.

-91 0955EST