Details on how they worked it out are not yet available, but a Democratic source said they have come up with an agreement now that everyone - House Democrats and moderate Senate Republicans - can live with.
Senators had slashed direct funding for school construction - a top priority for Democrats - and instead set aside money for governors to use on school modernization and rehabilitation. House Democrats did not believe that would ultimately be targeted enough to school districts in need.
"I want to thank the Democrats and Republicans in Congress who came together around a hard-fought compromise," said President Barack Obama in a statement.
Obama said the plan will save or create more than 3.5 million jobs and will provide immediate tax relief to families and businesses.
"I'm grateful to the House Democrats for starting this process, and for members in the House and Senate for moving it along with the urgency that this moment demands," said President Obama.
The deal comes after a drawn-out debate on Capitol Hill that culminated in a last-minute holdup related to the school construction issue.
Senate Majority Leader Harry Reid announced that a deal had been struck earlier Wednesday afternoon. But House Speaker Nancy Pelosi was not on hand when Reid said that the differences between the House and Senate versions of the bill had been resolved.
Aides to both Pelosi, D-Calif., and Reid, D-Nev., told CNN she had given Reid the green light to make the announcement, but she apparently then heard complaints from some rank-and-file Democrats.
After Reid announced the compromise bill, Sen. Max Baucus of Montana, a fellow Democrat, said it could be taken up by the two houses as early as Friday, meeting President Barack Obama's timetable of having the bill on his desk by Presidents Day, which is Monday.
"The bills were really quite similar, and I'm pleased to announce that we've been able to bridge those differences," Reid said. "Like any negotiation, this involved give and take, and if you don't mind my saying so, that's an understatement."
He praised the three "brave" GOP senators who broke ranks to support the bill: Sens. Susan Collins and Olympia Snowe of Maine and Sen. Arlen Specter of Pennsylvania.
Of the 219 Republicans in Congress, they were the only three to back the bill.
"Today we have shown that, working together, we can address the enormous economic crisis facing our country," Collins said.
She said the compromise bill has a price tag of $789 billion, less than both the House and Senate versions.
Reid said this middle ground creates more jobs than the original Senate bill, and spends less than the original House bill.
Sen. Ben Nelson, D-Neb., summed it up as a "jobs bill."
"Today you might call us the 'jobs squad,'" said Nelson, one of the key negotiators on the compromise. "Because that's what we're attempting to do: to make sure that people will have the opportunity to hang on to their jobs that they have today, and they'll be able to get jobs if they lose their jobs."
Collins on Wednesday provided details of some of the measures she expects to be in the final bill:
A homeowner tax credit significantly reduced from the Senate version of $15,000, double that of the House bill.A tax credit, also reduced from the Senate version, for people who buy a car in 2009.Funding to patch the alternative minimum tax, originally intended to target the wealthy but now hitting many middle-class families.$90 billion of increased Medicaid match to states.$150 billion for infrastructure, including $49.6 for transportation infrastructure.Nelson confirmed that tax breaks for workers that had been set at $1,000 per family or $500 per individual would be scaled back to $800 per family and $400 per individual.
Multiple Democratic sources said 35% of the bill deals with tax cuts, 65% with spending.
Baucus, chairman of the Senate Finance Committee, said it is possible the House could take the bill up as early as Thursday and the Senate possibly Friday.
Democrats in the Senate must hold on to at least two Republican votes to get the 60 votes needed to keep GOP opponents from blocking the bill. Not a single Republican voted in support of the House version of the bill, but the House Democrats had enough votes to pass it, despite 11 Democrats voting against it.
Noting those numbers, Sen. Lindsey Graham, R-S.C., said the agreement is hardly bipartisan.
"You couldn't pick up one Republican in the House, and you lost 11 Democrats. You've lost more Democrats than you've picked up Republicans. That's not bipartisanship," he said Wednesday on CNN's "The Situation Room."
"We're disappointed in the process and the substance," he said.
The three Republican senators who voted in favor of the package indicated Wednesday that they were pleased with the agreement.
"As I said, unless the bill remained virtually intact from what the agreement was last Friday, my support would be conditional on that, and we got there," said Specter. "I think it is an important component of putting America back on its feet."
Specter, who is up for re-election in 2010, said earlier Wednesday he's aware of the political danger he's putting himself in, but action is needed to pump up the ailing economy.
"I understand the peril, but I didn't run for the United States Senate to further my own political interests," he said on CNN's "American Morning."
Asked about the possible political backlash from his vote supporting the bill, Specter said, "It's a good plan. Not a perfect plan, but a good plan and I'll take my chances."
CNN's Dana Bash, Ted Barrett, Evan Glass, Paul Steinhauser, Brianna Keilar and Deirdre Walsh contributed to this report.
Stimulus bill pushes broadband
Stimulus: And now a Senate fight
Senate OKs stimulus - Now it’s deal time
Cabinet fates of Cooper, Bredesen may lie with Clinton