RICHMOND, FEB. 22 -- The Virginia Senate enacted and sent to the governor today legislation doubling the number of Northern Virginians who must have their automobile exhaust emissions tested and raising inspection fees from $5 to $12.50.

The measure, which the state said had to be passed to avoid losing millions of dollars in federal highway and environmental assistance, was approved on a 21-to-16 vote over the objections of nearly all the Senate Republicans and several rural Democrats.

Gov. Gerald L. Baliles is expected to sign the bill into law.

As approved by the Senate, owners of older cars would lose an ex-emption to testing. An automobile now is subject to annual emissions tests for eight years after its model year; the new law would require tests every two years on cars up to 20 years old.

The emissions law, which would apply to residents of Arlington, Fairfax and Prince William counties and the cities of Alexandria, Fairfax, Falls Church, Manassas and Manassas Park, would raise to 1.1 million the number of motorists whose vehicles must pass the test before the state will reregister their cars.

Service stations would be allowed to charge $12.50, rather than the current $5, to perform the emissions tests.

Del. Mary A. Marshall (D-Arlington), the bill's chief sponsor, said the tougher emissions law was needed to bring Northern Virginia into compliance with federal clean-air requirements.

Without the new law, the Washington suburbs stood to lose millions of dollars in federal aid for highway and sewage treatment programs.

"The penalties are heavy," Marshall said today. She stressed that cars will have to meet only those air pollution standards for which they were manufactured.

Two Northern Virginia senators denounced the bill before today's vote. Sen. Charles J. Colgan (D-Prince William) said it was inconsistent to make the law apply to those in his county, but not to motorists from neighboring Fauquier and Stafford counties who drive through Prince William every day.

"This bill is very expensive," Colgan said.

State Sen. Wiley F. Mitchell Jr. (R-Alexandria) also spoke and voted against the measure, saying he was "sick and tired" of being asked to vote on legislation when threatened with the cutoff of federal funds.