The Virginia General Assembly tonight narrowly approved a statewide gasoline tax and a separate Metro financing measure that together will add at least a nickel a gallon to the price of gasoline in Northern Virginia this summer.

The regional gasoline tax for Metro and the state's two-cent-a-gallon increase cleared the legislature despite a bitter last-minute schism among Northern Virginia lawmakers over the measures.

Effective July 1, the regional tax will add about three cents a gallon to the price of gasoline in Arlington and Fairfax counties and the cities of Alexandria, Falls Church and Fairfax, all communities served by the Metro transit system.

Passage of the two tax measures removed the biggest obstacles to adjournment of the 1980 General Assembly, a 60-day session that has been marked by intense wrangling between Republican Gov. John N. Dalton and conservative, antitax legislators.

The lawmakers resisted until the last day enactment of Dalton's statewide gasoline tax measure despite repeated warnings by the governor that the state's roadbuilding program was being imperiled by a sharp drop in gasoline tax revenues.

The tensions between Dalton and the overwhelmingly Democratic lawmakers were as apparent today as they were when the session began Jan. 9. Branding him "the Johnny Dalton taxman," Norfolk Sen. Peter K. Babalas predicted that legislators who backed the tax measures will see their votes "hung around your political necks like an albatross on land."

The governor, however, claimed victory hours before the session ended at 9:55 p.m. "You seldom get everything you want," the governor said at a news conference in his Capitol office, a floor above the legislative chambers.

"But virtually everything we asked for is still in the budget . . . I think there has been a recognition (by the legislature) of the problems that confront our state," he said. Dalton cautioned that the two-cent-a-gallon statewide gasoline tax, which brings Virginia's gasoline taxes to 11 cents a gallon, "will not solve" the current shortfall in highway revenues. He said additional taxes will be needed, but declined to be more specific.

Passage of the Northern Virginia gasoline tax also ended fears of some Washington area officials that the Virginia legislature would block receipt of $1.8 billion in federal funds needed for completion of the 101-mile Metro subway system. Under terms of a 1979 congressional act, Virginia, Maryland, and the District of Columbia are required to earmark a "stable and reliable" tax source to underwrite the costs of operating the increasingly expensive rail and bus system.

Both Maryland and District officials have given assurances they will comply with the law, but there had been doubts by Northern Virginians that their state legislature, dominated by conservative, downstate interests, would be willing to endorse a tax to fund the project.

Today that tax measure came within one vote of failing to clear the 100-member House of Delegates.

Though Northern Virginia's eight senators earlier had engineered the measure's easy approval in the Senate, the dispute among the region's house members imperiled passage of the bill in the other chamber.

Despite opposition from most of the legislators from the outer Washington suburbs, however, the House mustered the bare minimum 51 votes required to pass the local tax bill.

Dalton, who was forced to abandon a more sweeping statewide gasoline tax measure that would have raised money for both highway and Metro construction said late today that he would sign both bills.

The governor's statewide gasoline tax bill will raise about $120 million for the depleted Virginia highway fund. The regional gasoline tax would garner about $11 million in its first year -- only about a quarter of the expected $41.2 million Metro operating deficit Northern Virginia localities face next year.

The regional bill sponsored by Del. Warren G. Stambaugh (D-Arlington) and amended early today by the area's eight senators, would provide for a tax of 2 percent on retail gasoline sales this year and 2 percent more in 1982, bringing the regional tax to 4 percent.

The regional gasoline measure was hammered out in caucuses early today after legislators decided to scale down the tax's impact, partly out of fear of voter anger over the size of a tax called for in earlier versions of the bill.

The phased version satisfied Northern Virginia senators but opened up a long simmering rift in the House delegation because of disagreements about how the tax money would be levied and distributed.

These disagreements spilled out onto the House floor tonight when Northern Virginians from the outer suburbs, particularly Fairfax County, tried to block passage of the regional tax.

Del. Warren E. Barry (R-Fairfax) called the measure a travesty on the region's residents. He complained that the bill would not give local goverments the taxing flexibility they wanted.

"But we aren't giving those localities what they asked for," said Barry. "They asked for some tools. But now we want to give them a mandate."

The Fairfax legislators were particularly upset because the bill would impose the tax on the region without the consent of the five governing localities affected by the measure. They also had hoped to funnel at least some of the tax money to the local governments rather than send it directly to the Northern Virginia Transportation Commission, Metro's regional arm.

Stambaugh, however, argued for approval of a direct tax and defended the distribution method. "As long as we're going to take the hook for this anyway, we might as well go ahead and impose it ourselves," Stambaugh said.

The Arlington Democrat also warned that any local option provision might give Fairfax City the chance to kill the bill for the whole region, as it did in 1976 when a similar proposal for Metro financing cleared the Assembly. d

Even though Stambaugh could not persaude a majority of Northern Virginia legislators, he was able to muster enough support to push the bill through. "I have stood as much of this (debate on the Metro tax) as I can stand," complained Del. Richard Cranwell (D-Roanoke), who echoed the impatient please of other legislators eager to leave Richmond. "Let's vote on this thing and get it over with."

In the end, Stambaugh carried the day, with unanimous support from delegates from Arlington and Alexandria. Of Fairfax, Prince William and Loudon's 12 delegates, only Dorothy McDiarmid voted for the regional tax.

Freshman Del. John H. Rust (R-Fairfax), who opposed the regional tax, criticized a provision in the bill requiring localities to reduce property taxes or other local levies for one year to offset the gasoline tax's impact on area taxpayers.

With that arrangement, Russ argued, "local governments in Northern Virginia will not have the capacity to raise taxes to meet . . . their other expenses."

Opponents of Dalton's proposal had tried to stall a vote on the controversial bill by staging a filibuster Friday night, and today they drew out the proceedings by attempting to tack on several amendments designed to force the measure back to the House where they hoped it would be killed.

"If you're for the bill, reject all the amendments," urged Senate Majority Leader Hunter B. Andres (D-Hampton) as the Senate sat through more than two hours of debate prior to its 25-14 passage of the measure.

Sen. Dudley Emick (D-Botetourt) led the effort to get Republicans and Norther Virginians to help him scuttle the Dalton tax measures but conceded afterward that all the lawmakers had pretty much made up their minds before today's vote.

"You are following the leadership of your governor on an issue the people do not support," warned Emick, turning to face the Senate nine Republicans. Then, turning to members of the Northern Virginia delegation, Emick appealed for "no" votes.

"When you go home, you will be held accountable.That's bottom line, basic politics," Emick said. He also urged the Northern Virginians to oppose the bill because it contained no money for Metro construction.

"You've got nothing out of something you had every right to get help for," said Emick, a supporter of Metro measures in the past.

The atmosphere on the floor of both Houses was one of subdued relief after the gasoline tax issues were finished and the session wound toward its final halt at 9:55 p.m. Legislators milled around the halls munching snacks or lounged in the warm night air in the capitol parking lot as they awaited results from conference on six dispatched bills.

They finally approved a controversial act to protect the state's wetlands along the Atlantic shore from excessive development. There was also a last minute wrangle over the state budget, with House Appropriations Chairman Richard M. Bagley successfully winning a pet $3.4 million provision for community alcohol abuse centers that the Senate had removed.

Other disputes were trivial. The House wanted to redesignated Columbus Day (Oct. 12) as "Columbus-Yorktown Day" in honor of the colonial victory over the British. But it relented after the Senate insisted that after next year the holiday revert to being called Columbus Day.

House Speaker A. L. Philpott, who had hoped to end the session by 5:30 so that Democrats could attend the $50-a-plate dinner featuring First Lady Rosalynn Carter was forced to keep the legislators in session more than four hours longer.

While waiting for adjournment, some lawmakers tried their hands at poetry, Del. Clinton Miller, a Shenandoah Republican who had adamantly opposed the Dalton gasoline tax, penned "The Ballad of John Dalton" or "Catch Me Before I Tax Again." It was to be sung to the tune of "Tom Dooley" and went: Kick up your heels so high. Kick up your heels John Dalton. Your gas tax is going to fly. While all the people cry. You forced it on us badly, But you failed to use your charm. The figures changed and sadly You started twisting arms.