With time running out, an ideological battle over abortion and environmental issues threatened on Thursday to scuttle a congressional deal to avert a looming government shutdown.

The mood shifted from optimism to pessimism as Democratic and Republican leaders in the Congress blamed each other for a failure to agree on billions of dollars in spending cuts in a funding measure to keep the government operating beyond the midnight Friday deadline.

Republicans in the House of Representatives approved a stop-gap bill to push the deadline back a week that includes $12 billion in additional spending cuts and assures Pentagon funding through September 30.

Senate Democratic leader Harry Reid called the short-term extension a non-starter in the Senate because of the spending cuts. President Barack Obama promised to veto it.

Congressional negotiators worked through the night toward a compromise that would keep more than 800,000 government workers in their jobs, but Republican House Speaker John Boehner said we were closer to a number last night than we are this morning.

Democrats said there was general agreement on the numbers in the deal, and Reid blamed the impasse on a dispute over Republican policy provisions that seek to block public funding of birth control and stymie environmental protection efforts.

He said fiscal conservatives aligned with the Tea Party movement were driving the process by pushing an extreme agenda and cheering for a shutdown.

I am not nearly as optimistic, and that's an understatement, as I was 11 hours ago, Reid said.

Boehner is under pressure to stand firm in the talks from Tea Party conservatives who helped fuel last year's big Republican election gains with promises of deep spending cuts and reduced government.

If this government shuts down, and it looks like it's headed in that direction, it's going to be based on our friends in the House of Representatives, the leadership over there, focusing on ideological matters, Reid said.

Reid and Boehner attended White House talks in the afternoon for more than an hour with President Barack Obama and Vice President Joe Biden, but said no deal was reached. Another White House meeting is planned for 7 p.m. EDT.

With the U.S. economy in the early stages of a recovery from the worst recession since the 1930s, Obama told reporters after a late-night Wednesday meeting at the White House that a government shutdown would have ramifications all across this economy.

He said a shutdown could hit small business owners, applicants for home loans and workers who would be left without paychecks as the result of federal layoffs.

The investment firm Goldman Sachs estimated a government shutdown lasting more than a week could cost the economy $8 billion in missed federal spending, dragging down growth.

Vital U.S. services such as national defense, law enforcement, emergency medical care and air traffic control would continue, but national parks and museums would close and the processing of passport and a variety of loan applications would halt.

(Additional reporting by Donna Smith, David Alexander, Richard Cowan, Thomas Ferraro and David Morgan; Writing by John Whitesides; Editing by Vicki Allen)