An agreement on a tax package Thursday moved Congress closer to opening a vast area in the Gulf of Mexico, 125 miles south of Florida's panhandle, to oil and gas drilling.

Both the House and Senate attached the drilling legislation to a package of popular tax measures expected to win approval by week's end as Republicans wrap up the 109th Congress and turn control over to Democrats next year.

The drilling legislation also revamps revenue sharing from Gulf oil and gas production, sending hundreds of millions of dollars to four Gulf states for restoring coastal wetlands and repairing hurricane damage.

Environmentalists opposed the measure, calling it a gift to large oil companies. Drilling supporters — including a cross-section of the business community — argued it would provide access to badly needed energy resources, especially natural gas, and perhaps drive down prices.

The 8.3 million acres that would be opened to drilling are believed to contain 1.3 billion barrels of oil and 6 trillion cubic feet of natural gas, enough gas to heat 6 million homes for 15 years. The country uses about 21 million barrels of oil a day.

The drilling area was carefully crafted to gain support of Florida's lawmakers, with its eastern edge more than 200 miles from state beaches.

"This protects Florida," said Sen. Mel Martinez, R-Fla.

Sen. Mary Landrieu, D-La., called the drilling legislation critical to Louisiana and other Gulf Coast states recovering from hurricane Katrina and trying to restore storm-damaged wetlands. The measure would steer 37.5 percent of federal royalties to the four Gulf oil-producing states, with about half going to Louisiana.

While Louisiana's share would be about $100 million a year initially, the amount would dramatically grow after 2017 to more than $650 million annually because of increased production from not only the 8.3 million acres but elsewhere in the Gulf.

Some lawmakers and the Bush administration have raised concerns about shifting eventually billions of dollars in royalties from federal oil and gas to the four states — Louisiana, Mississippi, Alabama and Texas.

Nonetheless, the administration has supported the measure.

The Senate approved the bill last summer but House Republicans held out for broader access to oil and gas beneath the country's Outer Continental Shelf. A House bill passed earlier in the year would have lifted the long-standing moratorium that has barred offshore drilling in 85 percent of the country's coastal waters.

After suffering losses in last month's election, House GOP leaders accepted the Senate-passed bill that was limited to the Gulf region.

"I don't believe it represents the answer to our country's worsening supply situation," said Rep. John Peterson, R-Pa., who had been a co-sponsor of the broader drilling plan. But he said he now supported the Senate version as a first step to broader offshore drilling.

House GOP leaders had planned to bring up the legislation separately earlier in the week but shifted tactics because they could not get the two-thirds vote needed for passage under an expedited process.