(Adds House procedural vote)
WASHINGTON, March 22 (Reuters) - The U.S. Congress raced on Thursday to approve a massive spending bill and send it to President Donald Trump before a midnight Friday government shutdown deadline, in a move that would significantly boost defense and non-military funding through Sept. 30.
The House of Representatives cleared the way for a vote on the measure later on Thursday, voting 211-207 to open debate. If it clears the chamber despite opposition from some conservatives protesting the measure's crushing deficit spending, it is likely to have an easier time passing the Senate.
When coupled with recently enacted tax cuts, the bill is projected to result in budget deficits hitting more than $800 billion for this year. That could create political difficulties for Republicans running for re-election in November if the conservative wing of the party lashes out at this legislation.
Democrats complained that in the rush to pass the bill, few if any lawmakers had time to read through the 2,232-page tome to see what it actually contained.
For Trump, there are potential difficulties as well beyond the deficit-spending.
Trump, in a post on Twitter late on Wednesday, said the funding bill will allow him to start building a wall on the southwest U.S. border with Mexico. "Got $1.6 Billion to start Wall on Southern Border, rest will be forthcoming," he wrote.
But Democrats argued the added funds will help build or restore a range of other barriers, including existing fencing, and would not pay for a concrete edifice that Trump originally said would be financed by Mexico - a claim the Mexican government has denounced.
Passage of the spending bill would end several months of intense bickering between Republicans and Democrats over spending priorities, which led to two short government shutdowns earlier this year.
It also would deliver another setback to Trump, whose proposals for severe cuts to the Environmental Protection Agency, State Department and other federal agencies would be scaled back.
The bill, which also excludes some of Trump's immigration-related funding requests, was unveiled late on Wednesday. Senate No. 2 Republican John Cornyn said his chamber could take it up on Thursday night if no senator acts to slow it.
On Wednesday, the White House signaled that Trump would sign the legislation if Congress sends it to him.
House Republicans' conservative Freedom Caucus on Thursday said its roughly three dozen members would not back the bill because it massively increases spending while not defunding Obamacare, Planned Parenthood and so-called sanctuary cities.
"You're going to see lots of conservatives vote against it," U.S. Representative Jim Jordan, a caucus member, told Fox News in an interview.
Trump at one point wanted $25 billion included in the bill to fully fund construction of his proposed U.S.-Mexico border wall, but negotiations with Democrats to make that happen fell apart early this week, according to congressional aides.
Instead, Trump would get nearly $1.6 billion more for border security this year. More border patrol agents could be hired, but there would not be the significant increase in immigration agents working the interior of the country.
The Department of Homeland Security had sought a big buildup in those officers to boost deportation of undocumented immigrants.
Besides the $80 billion boost in military spending, the largest in 15 years, the measure includes new money for infrastructure improvements and combating Russian election hacking.
In response to public anger and frustration over mass shootings, including a Feb. 14 massacre at a Florida high school, the bill contains modest improvements to background checks for gun sales and grants to help schools prevent gun violence.
These provisions were far short of steps many Democrats and gun control groups say are needed to stop the shooting deaths of school children, concert-goers, church worshipers and others.
A so-called "grain glitch" included in a tax law enacted at the end of last year would be repaired by the legislation.
Big grain buyers, such as Anheuser Busch Inbev NV, Cargill Inc and the ethanol industry, have complained the glitch gives lucrative tax breaks to grain producers for selling to farming cooperatives, and a lesser break for selling to agriculture companies.
The bill will provide a $307 million increase above the administration's request for counter-intelligence efforts to fight Russian cyber attacks in 2018, when U.S. mid-term congressional elections will be held, and $380 million for grants to states to secure their election systems.
Other components of the bill include $10 billion in infrastructure spending for highways, airports, railroads and broadband, and a $2.8 billion increase to fund treatment and prevention of opioid addiction and research into the subject. (Additional reporting by Amanda Becker and Susan Heavey Editing by Bernadette Baum and Bill Trott)