Healthcare and defense stocks sank while shares of ethanol producers rallied Wednesday after Democrats gained control of the U.S. House.
The Capitol Hill power shift also stoked concern about possible trade protectionism and tax increases. Nonetheless, optimism seemed to trump fear: Stocks finished mostly higher, with the Dow Jones industrials at a record high.
Companies tied to infrastructure improvements gained after voters in California and a number of other states approved multibillion-dollar bond measures for public-works projects.
The stock market eased at the opening but began to rally shortly after word of Defense Secretary Donald Rumsfeld's resignation reached the market.
"That's the most tangible evidence that there is going to be a change of strategy in Iraq, and that has to be for the better," said Jack Ablin, investment chief at Harris Private Bank in Chicago.
The Dow, which fell about 54 points early on, ended with a gain of 19.77 points, or 0.2%, to 12,176.54 -- an all-time high, surpassing the previous closing peak of 12,163 reached Oct. 26.
Winners topped losers by more than 3 to 2 on the New York Stock Exchange.
The Standard & Poor's 500 index added 2.88 points, or 0.2%, to 1,385.72. The Nasdaq composite rose 9.06 points, or 0.4%, to a five-year high of 2,384.94.
Most Wall Street pros had expected a muted market reaction to the Democrats' gains in the House, because polls in recent weeks had predicted the turn.
The party's strength in Senate races, however, caught some investors by surprise, and may have triggered heavier selling in sectors including healthcare, which the market consistently views as a Democratic target for reforms that could limit the prices charged by drug makers and healthcare providers.
An S&P index of 14 big drug stocks fell 1.8%, led by Merck, which sank $1.56 to $44.34. Humana, which operates health maintenance organizations, slumped $3.46, or 5.9%, to $55.19.
Yet many analysts said they had little fear of a rash of anti-business measures -- or tax increases -- given President Bush's veto power.
"It's not like the Democrats now are going to sweep through their legislation," said Milton Ezrati, economic strategist at money management firm Lord, Abbett & Co. in Jersey City, N.J.
The idea of legislative gridlock appeals to some investors who believe that the economy fares best without government interference. That theme helped to underpin the market's strong rally since late July, as it became clearer that a power shift could occur in the House, analysts say.
One congressional move that Wall Street wanted -- an extension of the 2003 tax cuts on capital gains and dividend income -- was approved in May. The cuts won't expire until 2010.
"The extension of those tax cuts took the single biggest danger out of this election," said David Kelly, economic advisor at Putnam Investments in Boston.
As for gridlock, Bush signaled at a news conference Wednesday that he expected to find "common ground" with Democrats on many issues. He mentioned the federal minimum wage, which Democrats want to raise from $5.15 an hour.
An increase in the minimum wage could hurt the bottom line of employers including Wal-Mart Stores. Wal-Mart shares fell 62 cents to $47.03, an eight-week low. But shares of McDonald's, which also might be hit by rising wages, gained 36 cents to $42.03.
Major defense stocks were broadly lower. "Public frustration with Iraq suggests that a different set of defense policies could emerge in 2007-2009 to address U.S. security concerns," wrote Byron Callan, an analyst at Prudential Equity Group in New York, in a note to clients.
That could lead to a "recasting" of spending plans, he said.
Lockheed Martin shares fell $1.04 to $86.45; Northrop Grumman was off $1.42 to $64.98.
SLM Corp., a major provider of federally guaranteed student loans, tumbled $2.39 to $47.21. Some Democrats have called for cuts in student loan rates, which could crimp lenders' earnings.
On the plus side, some investors rushed into stocks of ethanol producers, betting that Democrats would do more to advance their fuel as an alternative to gasoline. Archer-Daniels-Midland jumped $2.20 to $35.73 and VeraSun Energy gained $1.69 to $20.40. Pacific Ethanol, which has built a large ethanol plant in Madera, Calif., rose $1.29 to $17.51.
But big oil stocks rose as well, as near-term crude futures in New York rose 90 cents to $59.83 a barrel, and after California voters defeated a proposal to tax crude production in the state.
Exxon Mobil climbed $1.60 to a record $74.13; ConocoPhillips gained $1.38 to $62.37.
Golden State voters' approval of $42.7 billion in new state bonds to pay for public-works projects including roads and levees helped drive up shares of companies that could benefit from that spending. Similar, but smaller, bond measures were passed in other states including Texas, Connecticut and North Carolina.