John W. Warner, the five-term U.S. senator from Virginia who helped plan the nation’s 1976 bicentennial celebrations, played a central role in military affairs and gained respect on both sides of the political aisle for his diligence, consensus-building and independence, died May 25 at his home in Alexandria, Va. He was 94.

His former chief of staff Susan Magill announced the death and said the cause was a heart ailment.

Because of his willingness to buck his increasingly conservative party, Mr. Warner became the Republican whom many Virginia independents and Democrats respected and voted for. By the time he retired in 2009, he held the second-longest tenure of any senator from Virginia.

As a former secretary of the Navy and, in later years, one of only a handful of World War II veterans in the Senate, Mr. Warner held considerable authority in military matters. His consensus-building on many critical issues led him to be known as one of the Senate’s more influential members. He also brought a touch of glamour to the political world through his six-year marriage to film star Elizabeth Taylor.

As chairman of the Armed Services Committee, Mr. Warner provided critical support for President George W. Bush’s handling of the war in Iraq, beginning in 2003. During debate on a Democratic call for the withdrawal of American troops from Iraq in 2007, Mr. Warner led the Republican opposition, saying, “What we have on the line is the credibility of the United States of America.”

The next year, however, he broke with the Bush administration’s proposed “surge” of additional troops for Iraq and disagreed with his own Senate ­subcommittee’s recommendation authorizing a higher level of military force. His stance strengthened Democratic efforts to curtail spending on the war.

“The reason I’m into this situation so deeply,” he said, “is that I feel that the American citizens have given so generously with their sons and daughters. Have we not fulfilled our commitment to the Iraqi people?”

He also urged the administration to give more attention to rebuilding the economy of Iraq.

Along with Sens. John McCain (R-Ariz.) and Lindsey O. Graham (R-S.C.), Mr. Warner co-sponsored legislation that banned the torture of terrorism suspects. He also opposed some Bush administration efforts to use military commissions to place terrorism suspects on trial at the U.S. Navy base at Guantanamo Bay, Cuba.

Mr. Warner frequently went against his party in domestic affairs. He supported legal abortion, although he voted in favor of numerous limitations on the procedure; supported gun control; voted against confirmation of President Ronald Reagan’s U.S. Supreme Court nominee Robert Bork; and urged lifting Bush’s restrictions on stem-cell research. In 2005, he was part of the bipartisan “Gang of 14” that prevented either party from using parliamentary maneuvers on judicial appointments.

He was no maverick, though. Mr. Warner supported the three Republican presidents under whom he served — Reagan and the two Bushes — more than 90 percent of the time.

On the home front, Mr. Warner used the clout of the chairmanship to steer billions of dollars in defense spending to Virginia’s shipbuilding and naval facilities.

Although his influence was wide, Mr. Warner’s legislative ­record was thin. In three decades in the Senate, he sponsored 194 bills, 21 of which were enacted, mostly related to defense; 120 didn’t make it out of committee.

'I'm in Warner's corner'

When Mr. Warner first sought public office, in 1978, his principal claim to fame was being the sixth husband of actress Elizabeth Taylor, but even that celebrity connection was not enough to capture the Republican nomination for Senate.

At the GOP state convention in Richmond, he finished second in a field of four. The presence of Taylor, or, as she described herself, “a housewife from a small town in Virginia,” in a sailor cap and a red-and-white striped shirt emblazoned with the slogan, “I’m in Warner’s corner,” attracted 100 journalists from as far away as England, plus two dozen Liz look-alikes.

None of that, however, was enough for Mr. Warner to defeat former Republican National Committee co-chairman Richard D. Obenshain, who edged Mr. Warner by 37 votes out of 3,000 cast on a sixth ballot.

That might have been the end of Mr. Warner’s political career, except that two months later Obenshain was killed in the crash of a private plane while campaigning. Ten days later, the state Republican committee reluctantly selected runner-up Mr. Warner as its replacement candidate.

Overnight, the tall, square-jawed Mr. Warner, dubbed the “candidate from Central Casting,” appeared to be the perfect antidote to the bumbling Sen. William L. Scott (R), who was retiring after one term during which his antics and arrogance had become an embarrassment to the party.

Mr. Warner was not only handsome but also rich, after a 1973 divorce from the banking heiress Catherine Mellon. She had bequeathed him a $7 million settlement, including a 2,100-acre estate, Atoka Farm, in Fauquier County. Over the years, Mr. Warner hosted annual fundraising picnics on the farm that attracted as many as 2,500 guests and raised millions for the Republican Party.

On the campaign trail, accompanied by the glamorous Taylor, an ebullient Mr. Warner trooped from Arlington County to Abingdon, playing down his upbringing as the son of a Washington surgeon and his taste for Savile Row suits, squash and fox hunting (one of his horses twice won the coveted Gold Cup steeplechase). Instead, he described himself as a farmer and cattleman.

“And I love country music,” said Mr. Warner, a trustee of the National Symphony more at home with grand opera than the Grand Ole Opry.

His Democratic opponent, Andrew P. Miller Jr., a former state attorney general, derided him as “the only farmer in Virginia with a swimming pool in his barn.”

Lacking any ties to Virginia politics, Mr. Warner instead emphasized his service as undersecretary and then secretary of the Navy in the Nixon administration from 1969 to 1974 and as head of the American Revolution Bicentennial Administration.

Although detractors scoffed at his occasionally corny or pompous patriotic pronouncements, Mr. Warner drew plaudits for planning the nation’s 200th birthday party, which culminated in Operation Sail, when tall ships from around the world massed near the Statue of Liberty on July 4, 1976.

Miller portrayed Mr. Warner’s high-visibility appointments — detractors called him Secretary “Mr. Warnermellon” — as payback for more than $1 million in campaign contributions Richard M. Nixon received from the Mellon family. Mr. Warner said that he had not given Nixon “one single penny, from my pocket or my wife’s,” until federal election records showed that he gave $5,000 to Nixon’s 1972 reelection campaign. Nixon’s first defense secretary, Melvin Laird, said “it’s a false charge” that Mr. Warner benefited from patronage.

Miller hammered at Mr. Warner’s wealth, and the source of it; by Election Day, Mr. Warner had lent his campaign nearly $1 million.

He won the general election by 4,721 votes out of 1.2 million cast in the closest Senate race in Virginia history.

On Capitol Hill, Mr. Warner quickly displayed his independent streak. He joined Rep. Herbert E. Harris II, a liberal Democrat whose district included Alexandria, in supporting increased funding for Washington-area jurisdictions to offset the presence of nontaxable federal property, an issue that Scott and the state’s senior senator, Harry F. Byrd Jr., opposed. Mr. Warner also cooperated with Harris in boosting funding for the burgeoning Metrorail system.

However, Mr. Warner didn’t ­neglect his conservative supporters. As time wore on, he compiled a voting record similar to that of Byrd, a Democrat-turned-independent whose influence in Virginia politics transcended party affiliation.

Mr. Warner’s celebrity status set off a flood of speaking invitations, most of which included a hope that his wife would be there, too. Most of his travels would be within the state, Mr. Warner promised: “She’s a big state, that wonderful mistress of Virginia.”

Such hyperbole was fodder for critics, who derided him as Mr. Elizabeth Taylor. In his “Doonesbury” cartoon strip, Garry Trudeau described Mr. Warner as “some dim dilettante who managed to buy, marry and luck his way into the Senate.” A Washington Star editorial cartoon titled “The Virginia Hunt” depicted Mr. Warner, the gentleman farmer, riding Taylor, the thoroughbred, to victory.

Six months into his first term, early assessments of Mr. Warner had begun to change. The Economist, a British magazine, rated his early performance that of “a serious student of the issues.”

From Navy to Pentagon

John William Warner was born in Washington on Feb. 18, 1927, and graduated from Woodrow Wilson High School. His father, John William Warner II, was an obstetrician and gynecologist who served as a field surgeon during World War I. His mother was Martha Stuart Budd Warner. An uncle was rector of St. Albans Episcopal Church.

Although he grew up in the District, Mr. Warner’s family had deep roots in Virginia. His paternal grandparents lived in Amherst County, and a great-uncle lost an arm while serving in the Confederate Army.

Near the end of World War II, at age 18, Mr. Warner joined the Navy and was stationed at the Great Lakes Naval Training Station near Chicago. Discharged as a petty officer third class in 1946, he enrolled at Washington and Lee University, where he received a degree in engineering. Graduating in 1949, he enrolled in law school at the University of Virginia but interrupted his studies and joined the Marine Corps during the Korean War. After being discharged at the rank of captain, he returned to Charlottesville and received a law degree in 1953.

He won a clerkship to Chief Judge E. Barrett Prettyman of the U.S. Court of Appeals in Washington, and then spent two years in private practice before becoming an assistant U.S. attorney.

Mr. Warner joined the law firm of Hogan and Hartson in 1960. He left to become an advance man in Nixon’s 1968 presidential campaign and directed Citizens for Nixon-Agnew. When Nixon won, Mr. Warner was named the Navy undersecretary, beginning five years of government service at the Pentagon.

It was while serving in that capacity that he met Taylor, at a luncheon at the British Embassy. They married in a small, quiet ceremony at Atoka Farm on Dec. 4, 1976, and settled into a Georgian mansion in Georgetown, where Mr. Warner had been living next door to his first wife.

He and Taylor separated in December 1981 and divorced the next year. They remained friends until Taylor’s death in 2011.

In 2003, Mr. Warner married Jeanne Vander Myde, an Alexandria real estate agent and the widow of Paul Vander Myde, an official in four Republican administrations.

Survivors include his wife, of Alexandria; three children from his first marriage, Virginia Warner of Middleburg, Va., Mary Conover of Aspen, Colo., and John W. Warner IV of Warren County, Va.; and two grandsons.

An independent streak

Mr. Warner didn’t need Taylor’s celebrity to win a second term, capturing 70 percent of the vote against Democrat Edythe C. Harrison in 1984. Six years later, the Democrats did not even field an opponent when he ran for a third term.

In 1994, Mr. Warner interceded in an ideologically fractious Senate contest between incumbent Charles S. Robb (D) and Oliver North (R). Mr. Warner threw his support to a third candidate, former Republican state attorney general J. Marshall Coleman, who was running as an independent. The splitting of the Republican vote was credited with allowing Robb to win.

The previous year, Mr. Warner, bemoaning the influence of conservative Christians and abortion opponents, refused to support the GOP nominee for Virginia lieutenant governor, Michael P. Farris. Democrat Donald S. Beyer Jr., now a Virginia congressman, easily defeated Farris in the general election.

Republican leaders sought revenge on Mr. Warner in 1996 by enticing James C. Miller III, a former head of the Office of Management and Budget, to challenge Mr. Warner in a party convention. But Mr. Warner, exerting his prerogative, forced a primary and was handily renominated.

That November, he faced the stiffest challenge of his career when a relative unknown Democrat, Mark R. Warner (no relation), spent more than $10 million of his own money and held Mr. Warner to 52 percent. (Mark Warner went on to become governor of Virginia and succeeded John Warner in the Senate.) In his final election in 2002, Mr. Warner again faced no Democratic opponent.

In his later terms, Mr. Warner continued exercising his independence. He was one of 10 Republican senators who voted against the charge of perjury in the impeachment of President Bill Clinton, and he spoke out against the military’s “don’t ask, don’t tell” policy, telling the chairman of the Joint Chiefs of Staff, Peter Pace, “I respectfully, but strongly, disagree with the chairman’s view that homosexuality is immoral.”

One week before announcing his retirement, Mr. Warner urged Bush to begin bringing troops home from Iraq by Christmas 2007, to emphasize to Iraqi leaders that the United States’ commitment was not indefinite.

As he retired, Mr. Warner was awarded the first National Intelligence Distinguished Public Service Medal; the Navy announced it would name its next Virginia-class submarine the USS John Warner; and Queen Elizabeth II named him an honorary Knight Commander of the British Empire for strengthening the U.S.-British military alliance.

Much to the consternation of some in his own party, the centrist Warner often chose pragmatism over ideology.

In retirement, at a conference on climate change with scientists, politicians and military brass, rather than viewing global warming in moral terms, Mr. Warner linked it with national security and energy independence. If Congress failed to enact climate change legislation, he said, “China and India and the rest of the nations in the world are going to eat our lunch.”

As he said early in his Senate career, “I have very little interest in protocol. We’ve got big problems . . . so I can’t let . . . tradition stand in the way.”