Pennsylvania Gov. William Scranton speaks to hometown well-wishers at the Scranton-Wilkes-Barre Airport in Scranton, Pa., in 1964. (AP Photo, File)

William W. Scranton, a former Republican governor of Pennsylvania, presidential candidate and ambassador to the United Nations, died July 28 in Montecito, Calif. He was 96.

The cause was a cerebral hemorrhage, a family spokesperson told the Associated Press.

A descendant of the family that gave the city in northeastern Pennsylvania its name, Mr. Scranton was primed for public service at a young age. As a candidate for the GOP presidential nomination in 1964, he became a leading protagonist in the ideological and regional battles that split the Republican Party that year; he was a Northeastern liberal fighting the forces that would tilt the GOP toward a deeper, mostly Southern conservatism.

Fifty years later the battle still rages, with Mr. Scranton’s native state tilting increasingly toward Democrats in national elections.

The Scranton family traced its lineage to the Mayflower. William’s grandfather, Joe Scranton, was a congressman. His father, Worthington, was a wealthy businessman. His mother, Marion Margery Warren Scranton, was a longtime member of the Republican National Committee and brought Mr. Scranton to presidential nominating conventions to meet future governors, senators and congressmen.

Despite her son’s early political education, his mother was not sure he had the temperament for politics. She worried that he would not be able to withstand the stress of campaigning and discouraged him from running when he decided to seek a seat in the House in 1960. She died before he defeated an incumbent Democrat, Stanley A. Prokop, in a largely Democratic district.

Mr. Scranton described himself as “a liberal on civil rights, a conservative on fiscal policy, and an internationalist on foreign affairs.” His two years in the House earned him a reputation as a moderate. He supported several initiatives of President John F. Kennedy, including the creation of the Peace Corps.

In 1962, Mr. Scranton won the Pennsylvania governorship by defeating the Democratic candidate, former Philadelphia mayor Richardson Dilworth, in a landslide.

As governor, Mr. Scranton led a major reform of the state’s education system. He introduced a Department of Mental Health and oversaw the creation of a Council of Science and Technology.

After Kennedy’s assassination in 1963, Mr. Scranton began drawing national attention as a possible Republican presidential candidate. But he deferred to Gov. Nelson Rockefeller of New York to represent the Northeastern liberal wing of the party in the race against Arizona Sen. Barry Goldwater, an arch-conservative at the time.

After Rockefeller was knocked out of the race, Mr. Scranton made a late entrance just before the 1964 convention. His aides ran an aggressive race, portraying Goldwater as dangerously conservative.

Goldwater crushed Mr. Scranton on the first convention ballot but went on to resounding electoral defeat to President Lyndon B. Johnson in one of the largest presidential landslides ever. Goldwater, however, became a conservative icon whose campaign was touted as the early seeds of the “Reagan revolution” of the 1980s.

Limited to one gubernatorial term, Mr. Scranton left the governor’s office in 1967. He never ran for elected office again. He went into private business, serving as a board member of corporations and service organizations and as a trustee of Yale University, his alma mater.

After his election to the White House in 1968, Richard M. Nixon approached Mr. Scranton about becoming the secretary of state. Mr. Scranton declined. He instead became a special envoy to the Middle East, where he offended many Jewish Americans by calling for a “more even-handed policy in the Middle East.”

Afterward, he served on a number of governmental boards until 1976, when President Gerald R. Ford appointed Mr. Scranton as the ambassador to the United Nations, a post he held for 10 months.

At the end of President Jimmy Carter’s administration and the outset of the Reagan presidency, Mr. Scranton participated in a delegation that advised U.S. leaders on Soviet-American relations.

William Warren Scranton was born July 19, 1917, in Madison, Conn., where his family had a summer home.

He studied history at Yale, where he received a bachelor’s degree in 1939. His classmates included McGeorge Bundy, the future national security adviser to presidents Kennedy and Johnson. Mr. Scranton received a law degree, also from Yale, after service in the Army Air Forces during World War II.

After working briefly in law and then in the textbook industry, banking and other businesses, Mr. Scranton began his career in public service in 1959 as a senior aide to Secretary of State John Foster Dulles and his successor, Christian A. Herter.

Coaxed into the House race by local Republicans, Mr. Scranton ran a campaign promising to lure jobs to a region that was increasingly down on its luck — a theme that still resonates today. He won by 17,000 votes even as Kennedy, a Democrat, defeated Nixon, a Republican, by 15,000 votes in the district.

Mr. Scranton married Mary Lowe Chamberlin in 1942. They had four children, including William W. Scranton III, who served as Pennsylvania’s lieutenant governor under Gov. Dick Thornburgh and was nominated by Republicans for the 1986 gubernatorial race. He lost to Democrat Robert P. Casey Sr.

A complete list of survivors could not immediately be confirmed.