The US House of Representatives has passed an aid package that will provide cash-strapped states with $26bn (£16.4) for healthcare and education.
The bill, which cleared the Senate last week, is now set to be signed by President Barack Obama, three months before the mid-term elections.
The president had appealed for the passage of the legislation, while Republicans condemned it.
The House had been called back for an emergency session for the vote.
The House voted 247 to 161 in favour of the bill, which supporters say will help to save the jobs of 100,000 teachers.
The package also includes $16.1bn to extend funding for the Medicaid healthcare programme for low-income Americans.
Republicans attacked the measure as an example of government overspending.
Excess government spending is one of the party's key themes in its campaigning for the mid-term elections in November.
Democrats fear that the weak US economy, high unemployment and Mr Obama's falling popularity will create problems for them in the polls.
Only hours before the vote on the aid bill, the president appealed to Congress to approve the legislation and support states about to lay off police, teachers and firefighters.
"America is watching and America is waiting for Washington to act," he said.
Most US states are bound by balanced budget requirements and not allowed to spend more than their income.