Winning a House seat in 2012 cost the victor on average twice as much as it did a quarter-century ago: about $1.6 million, compared with about $753,000 in 1986.

That increase is striking, given that most House races are not as competitive as they once were. The rise in spending is concentrated in a relatively small, and shrinking, number of battlegrounds. The phenomenon is illustrated by a collection of data from the Campaign Finance Institute, part of a broader set released on Tuesday by the Brookings Institution and the American Enterprise Institute.

Republicans and Democrats hold a similar number of safe seats, so it is conceivable that the House could change hands each election, said Thomas E. Mann of Brookings.

“Ironically, as competition for individual seats has declined, competition for the majority has increased,” Mr. Mann said. “And we’ve had more turnover than we had before.”

In 2012, the 256 incumbents who were re-elected by more than 60 percent of the vote – meaning they came from a safe district — spent an average of $1.3 million, while their long-shot challengers (171 of them) spent $154,000.

Compare that with the 100 incumbents in swing states who held on to their seats with less than 60 percent: They spent an average of $2.3 million, and their challengers spent $93,000.

It is more expensive for a House incumbent to lose: the 32 ousted representatives spent an average of $3.1 million trying to keep their seats, while their challengers spent $2.5 million.

All those figures represent money spent by the candidates themselves, without factoring in the ever-rising flood of funds spent by the political parties and independent groups like “super PACs.” And the swing-state incumbents are getting plenty of fund-raising help, Mr. Mann said.

“There’s a tremendous redistribution of money from, if you will, safe incumbents to unsafe ones, and that can be done by the parties,” Mr. Mann said. Entrenched members of Congress are also urged to donate their unneeded campaign funds to other candidates or to the political parties to spend where they see fit.

Senate seats were also more expensive than ever in 2012: the average cost was $10.4 million for victorious candidates. But since only one-third of the seats are decided in elections every two years, the numbers vary based on the sizes of the states.

So the 2012 number was slightly higher than the earlier record, in 2006, when victorious candidates from a virtually identical batch of states spent an average of $10.1 million, adjusted for inflation.