WASHINGTON (Reuters) - Democrats wasted no time flexing their new power in the U.S. House of Representatives on Thursday by approving legislation backed by new Speaker Nancy Pelosi that would end a 13-day partial government shutdown, ignoring President Donald Trump’s demand for $5 billion for a border wall.

The White House on Thursday issued a veto threat against both parts of the Democratic legislation. But that did not deter House Democrats.

Thursday marked the first day of divided government in Washington since Trump took office in January 2017, as Democrats took control in the House from his fellow Republicans, who remain in charge of the Senate.

The 2019-2020 Congress convened with roughly a quarter of the federal government closed, affecting 800,000 employees, in a shutdown triggered by Trump’s demand last month for the money for a U.S.-Mexican border wall - opposed by Democrats - as part of any legislation funding government agencies.

The House earlier on Thursday had formally picked Pelosi, a veteran Democratic lawmaker and liberal from San Francisco, as its speaker, beginning her second stint in one of Washington’s most powerful jobs. She is the only woman ever to serve as speaker and will preside over the most diverse U.S. House in history, including a record number of women and Latinos.

The two-part Democratic package includes a bill to fund the Department of Homeland Security at current levels through Feb. 8, providing $1.3 billion for border fencing and $300 million for other border security items including technology and cameras.

The second part would fund the other federal agencies that are now unfunded including the Departments of Agriculture, Interior, Transportation, Commerce and Justice, through Sept. 30, the end of the current fiscal year.

“We’re not doing a wall. It has nothing to do with politics. It has to do with a wall is an immorality between countries. It’s an old way of thinking. It isn’t cost effective,” Pelosi told reporters late on Thursday.

As speaker, Pelosi now is situated to lead Democratic opposition to Trump’s agenda and carry out investigations of his administration following two years during which congressional Republicans largely acquiesced to the president.

Trump on Thursday made an unannounced appearance in the White House briefing room to make the case for the border wall, accompanied by members of a union that represents border patrol agents that endorsed him for president in 2016. He congratulated Pelosi on her selection as speaker and said: “Hopefully we’re going to work together.”

“The wall - you can call it a barrier, you can call it whatever you want - but essentially we need protection in our country,” Trump told reporters, without taking questions.

‘THE WRONG FOOT’

Republican Senate Majority Leader Mitch McConnell signaled that the Democratic legislation had no future in the Senate, calling it “political theater, not productive lawmaking.”

Slideshow ( 7 images )

“Let’s not waste the time,” he said on the Senate floor. “Let’s not get off on the wrong foot with House Democrats using their platform to produce political statements rather than serious solutions.”

McConnell said the Senate would not take up any proposal that did not have a real chance of getting Trump’s signature.

Top Senate Democrat Chuck Schumer urged McConnell to allow the Democratic legislation to come to a vote in the chamber and said there was no reason to keep parts of the government unrelated to the border security issue shut down because of the wall standoff.

Slideshow ( 7 images )

“If Leader McConnell tonight would put the bill that’s passing the House on the floor, it would pass,” Schumer said, noting that the measures previously had been backed by Senate Republicans.

Congressional leaders from both parties held unproductive talks with Trump at the White House on Wednesday and are to return for another round on Friday, a sign the shutdown is likely to continue at least for the rest of the week.

After the November congressional elections, Republicans have a 53-47 majority in the Senate and Democrats have a 235-199 margin in the House, with one seat undecided.

Trump made the wall - a project estimated to cost about $23 billion - a key campaign promise in 2016, saying Mexico would pay for it and arguing it is needed to combat illegal immigration and drug trafficking. Democrats have called the wall immoral, ineffective and medieval.

Credit rating agency Moody’s said the shutdown would cause minimal U.S. economic and credit market disruption but there could be a more severe impact on financial markets and the broad economy if the closure is protracted.