Lawmakers moved closer to a confrontation with the Bush administration over guns in airplane cockpits as a House panel endorsed legislation that could arm more than 1,000 pilots in the next two years.

The House Transportation Committee's aviation subcommittee vote Wednesday runs counter to the administration's decision last month not to allow the arming of pilots. Similar legislation also has been introduced in the Senate.

Bipartisan groups of lawmakers in both houses are trying to overturn the decision of Transportation Security Administration head John Magaw to keep guns out of the cockpit. They are supported by the pilots' unions and the powerful National Rifle Association, itself a Bush ally.

Though the bill has a long way to go before it reaches Bush's desk, the panel's overwhelming voice-vote support illustrates how popular the idea appears to be on Capitol Hill despite the administration's opposition.

"It's a difference in policy between the bureaucrats and the elected officials," said subcommittee chairman John Mica, R-Fla. "I think we're closer to the people."

Republican and Democratic lawmakers on the aviation subcommittee worked out a compromise that would set up a two-year test program. During that period, up to 1,400 pilots -- 2 percent of the work force -- could volunteer to undergo training and obtain permission to carry guns on board an airplane they are piloting. Priority would be given to pilots with military or law enforcement backgrounds. Flight attendants would get separate self-defense training.

After two years, the Transportation Security Administration would decide whether to end the program, continue it, or expand it.

"Nothing else can provide the deterrence or effectiveness of a weapon wielded by a highly trained individual," Mica said.

Airline pilots have been pushing for the right to carry guns, and Air Line Pilots Association President Duane Woerth praised the House panel's action Wednesday.

"We give this bipartisan compromise our full support, and we thank all the legislators involved for allowing this issue to go forward," Woerth said.

The NRA, meanwhile, is urging its members to call the administration and Congress.

"Just as we trust pilots to be able to fly a complicated aircraft, we can trust them to be able to use a firearm as a last line of defense against terrorist hijackers," the NRA said.

While legislation progresses in the House, the bill is opposed by the head of the Senate panel with jurisdiction over the issue, Commerce Committee Chairman Ernest Hollings, D-S.C.

But senators who support arming pilots are trying to bypass the committee and offer the bill as an amendment to other legislation, possibly the defense authorization bill now on the Senate floor or the Transportation Department spending bill.

"We feel we have great support within the Senate for this because no one wants to be seen as anti-terrorism and anti-guns," said Eric Bovim, a spokesman for Sen. Conrad Burns, R-Mont.

Ironically, the Bush administration's allies on this issue are Democrats who usually oppose the White House.

"I agree with Secretary Magaw because, fundamentally, if a hijacking occurs, pilots must concentrate on maintaining control and landing the plane as soon as possible and not on confronting terrorists with weapons," said Rep. Eddie Bernice Johnson, D-Texas.

And Del. Eleanor Holmes Norton, D-D.C., said 98 percent of the pilots wouldn't be armed during the two-year test. "We are putting guns in planes but almost surely there will be no gun in your plane," she said.

The bill is to come before the full House Transportation Committee next Wednesday.