More than 300,000 Maryland residents will pay higher income taxes under a package given final approval by the legislature Wednesday.

The tax increase affects single-filers reporting income in excess of $100,000 and joint-filers reporting more than $150,000 in Maryland, the state with the nation’s highest per-capita income.

Democratic lawmakers closed ranks behind Gov. Martin O’Malley (D), who argued that his administration needed more money to continue record spending on education.

O’Malley’s tax increases — combined with a move the legislature supported to shift teacher pension costs to counties — will close half of a $1 billion gap that had been forecast for the rest of the decade.

The legislation — passed by the Senate on Tuesday and the House on Wednesday — will also widen the income tax divide between Maryland and Virginia. Maryland’s new top state-local tax bracket will tie the District’s for fourth-highest in the nation, at 8.95 percent. Across the Potomac, the top rate in Virginia is 5.75 percent.

Direct comparisons are tricky because Virginia has local sales taxes and Maryland counties can levy income taxes. But accountants said the difference routinely adds up to thousands of dollars a year on six-figure incomes.

Maryland’s tax package, they said, will add hundreds or thousands of dollars to many residents’ tax bills in the D.C. suburbs.

In an appearance before reporters, O’Malley thanked legislators for making what he said were “the right votes to keep our state moving forward. . . . We have together decided to invest more in the education of our children.”

Despite an agreement among Democratic lawmakers on a similar tax package last month, the measure was never brought to a vote. It collapsed along with a bill to expand gambling and allow a casino to be built in Prince George’s County.

The General Assembly adjourned its annual session April 9 in disarray, having approved a spending plan but not a revenue bill that was widely expected to pass. Without reconvening to approve the tax increases, the spending plan would have required more than $400 million in cuts to schools and state programs beginning July 1.

Cuts to classrooms, libraries and police in Prince George’s would have topped $65 million, boosting the county’s projected shortfall by 50 percent. Montgomery County would have lost more than $41 million, with a similar effect on its budget gap.

Counties and unions for state employees, who will receive a 2 percent raise from the tax increase, praised the legislature after the House of Delegates voted 77 to 60 for the package. Several Democrats joined Republicans in opposing the measure, arguing that the state could have taken money from elsewhere to maintain aid to education and county governments.

On the issue of state competitiveness, O’Malley said the tax increase would put Maryland “ahead of where most states are when addressing budget shortfalls.”

But raising taxes on six-figure earners set a marker amid the national debate about income disparity and how much the wealthy should pay to support government. Maryland’s tax increase will hit many below the $250,000 threshold above which President Obama has sought to impose tax increases on high-income earners.

Maryland’s tax increase will also come with a big first bite: The increase — a quarter of a percentage point increase on income in excess of $100,000 for single filers and $150,000 for joint filers — will be retroactive to Jan. 1. In coming weeks, the state will direct employers to adjust payroll deductions to collect the full year’s increase in the second half of the calendar year, state officials said.

A heavy concentration of those affected live in the Washington suburbs. Nearly one-third of the 300,000 taxpayers who reported six-figure incomes in Maryland last year were residents of Montgomery County. According to state budget analysts, the average cost per affected taxpayer in the county will be $745.

Joseph Henchman, vice president of the nonpartisan Tax Foundation, said the cost would be about $990 for a family of four reporting a combined income of $250,000.

“That makes Maryland’s burden higher than that in the District, and about $6,000 more than in Virginia,” Henchman said. “There are benefits, too, with the services that pays for, but at some point you’re paying so much more . . . that there is an effect.”

O’Malley and Virginia Gov. Robert F. McDonnell (R), each the head of his party’s governors association, have increasingly engaged in head-to-head comparisons while competing for prospective employers that relocate to the region.

Northrop Grumman recently began moving its headquarters from California to Northern Virginia. And last year Bechtel moved more than 600 jobs from Frederick County to Fairfax County, even as Maryland offered the company incentives to keep hundreds behind.

O’Malley has countered that General Motors has expanded its production of electric hybrid engines in Baltimore and that the number of private-sector jobs has increased by a higher percentage in Maryland in the past 12 months than in Virginia.

But this week’s action by Maryland lawmakers also diverged notably from steps taken in other Democratic-leaning states.

Last year, New York increased tax rates for its wealthiest residents, but the state cut taxes for most couples reporting incomes of less than $300,000. And California Gov. Jerry Brown (D) will ask voters in November to approve higher taxes on the wealthy to close a growing budget gap. But his ballot measure would hit those with incomes above $250,000.

Since the recession, 10 states have raised income tax rates, but seven of the increases were temporary and have since been reduced, Henchman said.

This week’s action on taxes left only the gambling issue unresolved for the legislature. O’Malley said he is committed to holding a second special session, probably in July, to take another look at an expansion of casino gambling.

“Certainly, we have to address the gaming issue,” O’Malley said. “The presiding officers are pretty committed to it, as am I.”

Maryland tax increases

Marginal tax rate increases

For single filers, on income of:

●$100,001 to $125,000: to 5 percent from 4.75 percent.

●$125,001 to $150,000: to 5.25 percent from 4.75 percent.

●$150,001 to $250,000: to 5.5 percent from 5 percent.

●$250,001 to $500,000: to 5.75 percent from 5 percent or 5.25 percent.

●$500,001 and above: to 5.75 percent from 5.5 percent.

For joint filers, on income of:

●$150,001 to $175,000: to 5 percent from 4.75 percent.

●$175,001 to $225,000: to 5.25 percent from 4.75 percent or 5 percent.

●$225,001 to $300,000: to 5.5 percent from 5 percent.

●$300,001 to $500,000: to 5.75 percent from 5 percent or 5.25 percent.

●$500,001 and above: to 5.75 percent from 5.5 percent.

Exemption reductions

For single filers, on income of:

●$100,001 to $125,000: to $1,600 from $2,400.

●$125,001 to $150,000: to $800 from $1,800.

●$150,001 and above: to zero from $1,200 or $600.

For joint filers, on income of:

●$150,001 to $175,000: to $1,600 from $2,400.

●$175,001 to $200,000: to $800 from $1,800.

●$200,000 and above: to zero from $1,200 or 600.

Source: Maryland General Assembly

Staff writer John Wagner contributed to this report.