The cause was complications of pulmonary fibrosis, said his son, Fred.

Mrs. Smith had served four terms in the Senate when Mr. Hathaway, then a congressman, ousted her in a vigorous campaign in which he visited most towns in Maine twice. She had gained the status of legend, in part because of her early opposition to the bullying tactics of Senator Joseph R. McCarthy, the anti-Communist crusader. She was the Senate's only woman at the time of her defeat.

In the face of a sweep of New England by President Richard M. Nixon, Mr. Hathaway won by persuading traditionally Republican Mainers to split their votes. Political analysts praised his low-budget, low-key television commercials, which showed him traversing Maine talking about small-town issues. By contrast, Senator Smith campaigned only on weekends until Congress adjourned two weeks before the election.

Mr. Hathaway also emphasized his relative youth: he was 48 years old, Mrs. Smith 74.

Soon after his election, Senator Hathaway, a liberal, received a letter from a young Maine woman complaining that she had been rejected by the United States Military Academy at West Point, N.Y., because she was female. He introduced legislation that led to the admission of women at West Point and other military academies in 1976.

In 1973, he joined two other Democrats, Thomas F. Eagleton of Missouri and Gaylord Nelson of Wisconsin, as the only senators to oppose Nixon's nomination of Representative Gerald R. Ford, the Republican House leader, to be vice president. He said he was concerned that the country would eventually have as its president a man appointed by a president under the cloud of possible impeachment — which is what happened.

William Dodd Hathaway was born in Cambridge, Mass., on Feb. 21, 1924, and grew up in a working-class neighborhood of Boston. He enlisted in the Army in 1942 and served as navigator on a B-24 bomber that was shot down on a bombing run on German oil refineries in Romania. He was wounded and held prisoner by the Germans for three months. He was awarded several medals, including the Purple Heart and the Distinguished Flying Cross, and was discharged as a captain in the Army Air Forces.

He graduated from Harvard and Harvard Law School, then joined a private law practice in Lewiston, Me.

Mr. Hathaway was elected to the House in 1964 and re-elected three times. He strongly supported President Lyndon B. Johnson's antipoverty programs and helped lay the legislative groundwork to establish the Occupational Safety and Health Administration.

In 1978, he was defeated in his bid for a second term by William Cohen, a Republican who was later defense secretary in the administration of President Bill Clinton. Mr. Hathaway then worked as a lawyer and lobbyist in Washington until President George Bush named him to the Federal Maritime Commission in 1990. He was the panel's chairman from 1993 to 1996.

Mr. Hathaway's wife of 61 years, Mary Lee Bird, died in 2007. In addition to his son, he is survived by his daughter, Susan Boydston; five grandchildren; and one great-grandchild.

In 2009, Mr. Hathaway recalled his mother's reaction after he defeated the revered Mrs. Smith. "Mother said, 'You ought to be ashamed of yourself,' " he said.