WASHINGTON — Tall and courtly, Tom Foley served 30 years in the House when partisan confrontation was less rancorous than today and Democrats had dominated for decades. He crowned his long political career by becoming speaker, only to be toppled when Republicans seized control of Congress in 1994, turned out by angry voters with little taste for incumbents.

Foley, the first speaker to be booted from office by his constituents since the Civil War, died Friday at the age of 84 of complications from a stroke, according to his wife, Heather.

She said he had suffered a stroke last December and was hospitalized in May with pneumonia. He returned home after a week and had been on hospice care there ever since, she said.

"Foley was very much a believer that the perfect should not get in the way of the achievable," Ms. Foley wrote in a 10-page obituary of her husband. She said he believed that "half of something was better than none."

"There was always another day and another Congress to move forward and get the other half done," she wrote.

"America has lost a legend of the United States Congress," President Barack Obama said in a statement Friday, adding, "Tom's straightforward approach helped him find common ground with members of both parties."

Foley, who grew up in a politically active family in Spokane, Wash., represented that agriculture-heavy area for 15 terms in the House, including more than five years in the speaker's chair.

In that job, he was third in line of succession to the presidency and was the first speaker from west of the Rocky Mountains.

Though the politics of Foley's era was less sharp-edged than today, it was not without hardball. As he became speaker in June 1989, a Republican National Committee memo was circulated called, "Tom Foley. Out of the Liberal Closet," that said Foley's voting record was as liberal as that of openly gay Rep. Barney Frank, D-Mass.

Some lawmakers took the memo as hinting that Foley was gay, which he denied. The White House said then-President George H.W. Bush was "disgusted" by the incident, and Foley said he considered the episode closed.

As speaker, he was an active negotiator in the 1990 budget talks that led to Bush breaking his pledge to never raise taxes, which played a role in Bush's 1992 defeat. Even so, Bush released a statement Friday lauding Foley.

"Tom never got personal or burned bridges," said Bush. "We didn't agree on every issue, but on key issues we managed to put the good of the country ahead of politics."

Foley also let the House vote on a resolution authorizing Bush to use force against Iraq for its 1990 invasion of Kuwait, despite "strong personal reservations and the strenuous objections of a good many" Democrats, Bob Michel, an Illinois Republican who was House minority leader at the time, recalled Friday.

"But he granted our request for a vote because it was the right thing to do. He was that kind of leader," Michel said in a statement.

Foley was also at the helm when, in 1992, revelations that many lawmakers had been allowed to overdraw their checking accounts at the House bank provoked a wave of anger against incumbents.

In 1993, he helped shepherd President Bill Clinton's budget through the House over solid Republican opposition. He also won passage of the North American Free Trade Agreement, despite "no" votes from most Democrats.

He never served a day as a member of the House's minority party. The Republican capture of the chamber in the 1994 gave them control for the first time in 40 years and Foley, it turned out, was their prize victim.

He was replaced as speaker by his nemesis, Rep. Newt Gingrich, R-Ga., leader of a group of rebellious younger Republicans who rejected the less-combative tactics of established GOP leaders like Michel.

Foley was defeated in 1994 by 4,000 votes by Spokane attorney George Nethercutt, a Republican who supported term limits, which the speaker fought. Also hurting Foley was his ability to bring home federal benefits, which Nethercutt used by accusing him of pork-barrel politics.

On Friday, House Speaker John Boehner, R-Ohio, called Foley "forthright and warmhearted" in a written statement.

"Tom Foley endeared himself not only to the wheat farmers back home but also colleagues on both sides of the aisle," Boehner said. "That had a lot to do with his solid sense of fairness, which remains a model for any speaker or representative."

House Minority Leader Nancy Pelosi, D-Calif., called Foley "a quintessential champion of the common good" who "inspired a sense of purpose and civility that reflects the best of our democracy."

In a 2004 Associated Press interview, Foley spoke about how voters did not appreciate the value of service as party leader and said rural voters were turning against Democrats.

"We need to examine how we are responding to this division ... particularly the sense in some rural areas that the Democratic Party is not a party that respects faith or family or has respect for values," he said. "I think that's wrong, but it's a dangerous perception if it develops as it has."

Foley loved the classics and art, hobnobbing with presidents, and his steady rise to power in Congress and diplomacy. He had a fine stereo system in his Capitol office.

He also loved riding horseback in parades and getting his boots dirty in the rolling hills of the Palouse country that his pioneer forebears helped settle.

Legendary Washington Democratic Sen. Henry M. "Scoop" Jackson was his mentor and urged his former aide to run for the House in 1964, which turned out to be a landslide year for Democrats.

Foley worked with leadership to get plum committee assignments. Retirement, new seniority rules, election losses and leadership battles lifted Foley into the Agriculture Committee chairmanship by age 44, a post he used to help expand the Food Stamp program. He later become Democratic whip, the caucus' No. 3 job.

Similar good fortune elevated him to majority leader, and the downfall of Jim Wright of Texas, who was facing ethics allegations, lifted him to the speaker's chair, where he served from 1989 until January 1995.

"I wish I could say it was merit and hard work, but I think so much of what happens in a political career is the result of circumstances that are favorable and opportunities that come about," Foley told the AP in 2003.

He said his proudest achievements were farm bills, hunger programs, civil liberties, environmental legislation and civil rights bills. Even though his views were often considerably to the left of his mostly Republican constituents, he said he tried to stay in touch.

After leaving Congress, he joined a blue chip law firm in Washington, D.C., and earned fees serving on corporate boards. Foley and his wife, Heather, his unpaid political adviser and staff aide, had built their dream home in the capital in 1992.

In 1997, he took one of the most prestigious assignments in diplomacy, ambassador to Japan under President Bill Clinton. A longtime Japan scholar, Foley had been a frequent visitor to that nation, in part to promote the farm products his district produces, and he held the post for four years.

Foley's father, Ralph, was a judge for decades and a school classmate of Bing Crosby's. His mother, Helen, was a teacher.

Foley attended Gonzaga University in Spokane and the University of Washington Law School. He worked as a prosecutor and assistant state attorney general and as counsel for Jackson's Senate Interior Committee for three years.

Then came the long House career.

Cornell Clayton, director of the Foley Institute for Public Policy at Washington State University, said that growing up during the Depression and World War II made Foley part of a generation that worked in a more bipartisan manner.

"They saw us all on the same team," Clayton said.