A tweet from President Donald Trump has thrown Republican plans to avoid a government shutdown into chaos by contradicting his own administration.

Congress has been scrambling to pass a short-term measure before a shutdown comes into effect on Saturday. House Majority Leader Kevin McCarthy said “we’re in very good shape” for passage of a spending bill that would keep the government running for another four weeks. The measure would next head to the Senate, where it faces a more uncertain future.

But before any votes had even occurred, Mr Trump seemed to blow up Republican leaders’ plan when he tweeted that a long-term extension of the popular Children’s Health Insurance Program should not be part of the spending measure being put to the House.

“CHIP should be part of a long term solution, not a 30 Day, or short term, extension!” the president wrote.

The White House was quickly forced to do some damage control, putting out a statement that said Mr Trump supports the House effort to avert a government shutdown.

“The President supports the continuing resolution introduced in the House,” White House spokesman Raj Shah said. “Congress needs to do its job and provide full funding of our troops and military with a two-year budget caps deal. However, as the deal is negotiated, the President wants to ensure our military and national security are funded. He will not let it be held hostage by Democrats.”

Since September, Congress has already passed multiple short-term spending bills, known on Capitol Hill as “continuing resolutions” - or CRs – to try to keep negotiations on immigration alive.

“It’s a mess,” said Senate Minority Leader Chuck Schumer. “We can’t keep careening from short-term CR to short-term CR. If this bill passes, there will be no incentive to negotiate and we will be right back here in a month with the same problems at our feet.”

Senate Majority Leader Mitch McConnell said his colleagues “on the other side of the aisle do not oppose a single thing in this bill.”

He continued: “They know they can’t possibly explain to our warfighters and veterans, to our seniors, to our opioid treatment centers, to the millions of vulnerable children and their families who depend on S-CHIP for coverage, or to all the Americans who rely on the federal government for critical services like food inspections and Social Security checks.”

Speaking to reporters at the Pentagon, Mr Trump said that if there was a government shutdown for any reason, “the worst thing is what happens to our military. “

“If the country shuts down, which could very well be, the budget should be handled a lot differently than it’s been handled over the last long period of time — many years,” Mr Trump said.

While past shutdowns have done little lasting economic damage, they can hurt federal workers, rattle markets and shake confidence in the US abroad.

House Speaker Paul Ryan predicted that the four-week continuing resolution would pass – despite lingering uncertainty over whether enough votes in the 435-member chamber had been secured.

“I have confidence we’ll pass this because I think members understand, ‘Why on earth would we want a government shutdown?’” the Wisconsin Republican said.

Donald Trump's first year: in pictures Show all 29 1 /29 Donald Trump's first year: in pictures Donald Trump's first year: in pictures Inauguration - 20 January 2017 US President Donald Trump acknowledges the audience after taking the oath of office as his wife Melania (L) and daughter Tiffany watch during inauguration ceremonies swearing in Trump as the 45th president of the United States on the West Front of the US capital in Washington on 20 January, 2017. Photographer Jim Bourg: "This photo was shot with one of two remote cameras. The cameras were monitored and triggered remotely and the pictures were transmitted to clients worldwide within minutes of being taken." Reuters/Jim Bourg Donald Trump's first year: in pictures Obama farewell address - 10 January 2017 US President Barack Obama wipes away tears as he delivers his farewell address in Chicago on 10 January, 2017. Photographer Jonathan Ernst: "In his final days in office, Obama made a visit home to Chicago. As he spoke from the stage to his wife and daughter in the audience, he became emotional when he talked about what they had sacrificed during his time in office. I turned from photographing the Obama women embracing to find him onstage wiping away tears." Reuters/Jonathan Ernst Donald Trump's first year: in pictures Inauguration - 20 January 2017 A combination of photos shows the crowds attending the inauguration ceremonies to swear in U.S. President Donald Trump at 12:01pm (left) on January 20, 2017 and President Barack Obama sometime between 12:07pm and 12:26pm on January 20, 2009. Reuters/ Lucas Jackson/Stelios Varias Donald Trump's first year: in pictures Liberty Ball - 20 January 2017 US President Donald Trump and first lady Melania Trump attend the Liberty Ball in honour of his inauguration in Washington on 20 January, 2017. Photographer Jonathan Ernst: "What I see when I look at this picture is the end of a very long day, not to mention weeks and months of preparation by many photographers, editors and network experts and the beginning of everything since." Reuters/Jonathan Ernst Donald Trump's first year: in pictures Inaugural Law Enforcement Officers and First Responders Reception - 22 January 2017 US President Donald Trump greets Director of the FBI James Comey as Director of the Secret Service Joseph Clancy (L), watches during the Inaugural Law Enforcement Officers and First Responders Reception in the Blue Room of the White House on 22 January, 2017. Photographer Joshua Roberts: "I have covered the White House for 16 years and normally either the President or the pool is in position when an event starts. In this case the President was not where anyone expected him to be. In fact, he was almost blocking the door when the pool came in. We had to scramble to find a position without bumping him or the furniture as he greeted and thanked members of law enforcement for their security efforts during the inauguration. Luckily, he greeted FBI Director James Comey a few seconds after the pool had made its way into the room." Reuters/Joshua Roberts Donald Trump's first year: in pictures Private phone calls to world leaders - 28 January 2017 US President Donald Trump, is joined by his staff, as he speaks by phone with Russia's President Vladimir Putin in the Oval Office on 28 January, 2017. Photographer Jonathan Ernst: "Very early in the Trump administration, weekends were as busy as weekdays. On Trump's second Saturday the official schedule said he would be making private phone calls to a number of world leaders including Russia's Vladimir Putin. I arrived early and, before sitting down at my desk walked up to Press Secretary Sean Spicer's office. He, too, was just taking his coat off. I gingerly made the suggestion that previous administrations had sometimes allowed photos of such phone calls through the Oval Office windows on the colonnade. To my mild shock, he didn't even think about it twice. "We'll do it!" he said. In truth, I really only expected the Putin call, but we were outside the windows multiple times throughout the day as the calls went on." Reuters/Jonathan Ernst Donald Trump's first year: in pictures Senior advisor Kellyanne Conway - 27 February 2017 Senior advisor Kellyanne Conway (L) attends as US President Donald Trump welcomes the leaders of dozens of historically black colleges and universities (HBCU) in the Oval Office on 27 February, 2017. Photographer Jonathan Ernst: "We're often asked how much access we have to the Trump administration, and the answer is we have an awful lot. President Trump himself is very comfortable in the spotlight, and his aides are similarly unfazed by cameras. In this instance, senior advisor Kellyanne Conway was so comfortable in our presence she seemed not to consider the optics of kneeling on a Oval Office sofa to take pictures with her phone." Reuters/Jonathan Ernst Donald Trump's first year: in pictures Angela Merkel heads to Washington - 17 March 2017 Germany's Chancellor Angela Merkel and US President Donald Trump hold a joint news conference in the East Room of the White House on 17 March, 2017. Photographer Jonathan Ernst: "Chancellor Merkel made one of the earliest important visits of any US allies to meet Trump in his first months in office. When world leaders give joint news conferences they don't always tend to give each other their full attention - but Merkel watched Trump intently at several key moments, and here seemed particularly rapt." Reuters/Jonathan Ernst Donald Trump's first year: in pictures Trump welcomes truckers to the White House - 23 March 2017 President Trump reacts as he sits on a truck while he welcomes truckers and CEOs to attend a meeting regarding healthcare at the White House on 23 March, 2017. Photographer Carlos Barria: "The White House organised a listening session with truckers and CEO's of major American companies, regarding healthcare reform. An 18-wheeler tow truck was parked on the South Lawn of the White House and as Trump welcomed the truckers someone invited the him to come and sit in the driver's seat. Trump jumped into the cab and started yelling and pretending to drive - creating one of the most memorable pictures of the year. A lesson learned, always be prepared for the unexpected." Reuters/Carlos Barria Donald Trump's first year: in pictures Air Force One - 6 April 2017 US President Donald Trump talks to journalists members of the travel pool on board the Air Force One during his trip to Palm Beach, Florida on 6 April, 2017. Carlos Barria: "During the many trips to President Trump's residence in Florida it is usual to see the president coming to the back of the plane to chat with journalists. During one of the trips to the so called 'Winter White House', Trump had a long talk with reporters while the Air Force One entertainment system was playing one of the latest Star Wars movies. As I was listening to Trump talk I was also looking at the movie waiting for a part of the movie to frame the mood of the day. Of the many scenes, I choose the one with Darth Vader." Reuters/Carlos Barria Donald Trump's first year: in pictures 100 Days - 27 April 2017 US President Donald Trump speaks during an interview with Reuters in the Oval Office of the White House on 27 April, 2017. Photographer Carlos Barria: "A day before President Trump's hundred days in office I was part of the team that interviewed the commander-in-chief in the Oval Office. I was only allowed to photograph Trump during the last five minutes of the interview. The time was very tight so I had to move fast as I had pictures in mind that I wanted to shoot. I walked into the Oval Office and saw that the President had printed maps of the country showing areas in red where he won. I raised my hands holding my camera as high as possible to get the best view of the scene using a 16mm wide angle lens." Reuters/Carlos Barria Donald Trump's first year: in pictures 100 Days - 27 April 2017 US President Donald Trump reacts as he arrives at Harrisburg international airport, before attending a rally marking his first 100 days in office in Pennsylvania on 29 April, 2017. Photographer Carlos Barria: "President Trump travelled to Harrisburg, Pennsylvania to celebrate his hundred days in office with a victory rally. He was in friendly territory as he won with a big difference over his opponent Hillary Clinton in Pennsylvania, during the November elections. As usual when the commander-in-chief arrives local residents gather to greet him. This time a small group of military personnel attended the arrival. Surrounded by secret service agents Trump walked from the Air Force One and raised his hand in a sign of victory as the crowd cheered him on." Reuters/Carlos Barria Donald Trump's first year: in pictures White House staffers - 2 May 2017 White House Press Secretary Sean Spicer (L) and White House Chief of Staff Reince Priebus watch as US President Donald Trump presents the U.S. Air Force Academy football team with the Commander-in-Chief trophy in the Rose Garden of the White House in Washington on 2 May, 2017. Photographer Joshua Roberts: "Covering the White House does not just mean covering the President. White House staffers are an important part of the story and their relationship with the President and each other is an indicator of how things are going in the West Wing. The tendency is to focus exclusively on the President once an event starts but I always try to look around to see how people are reacting as things unfold." Reuters/Joshua Roberts Donald Trump's first year: in pictures Secret Service - 4 May 2017 Secret Service agents use a presidential limousine as cover from spraying water as US President Donald Trump lands via Marine One helicopter in New York on 4 May, 2017. Photographer Jonathan Ernst: "The best part of any trip to New York City with the sitting US President is the helicopter ride into Manhattan. The ride out at night can be stunning. Here, Secret Service agents protect themselves from the spray from the East River as Trump lands on the helipad." Reuters/Jonathan Ernst Donald Trump's first year: in pictures NATO Summit - 25 May 2017 US President Donald Trump and first lady Melania Trump wait the arrival of French President Emmanuel Macron (unseen) before a lunch ahead of a NATO Summit in Brussels on 25 May, 2017. Photographer Jonathan Ernst: "One of the best parts of travelling overseas for White House coverage is the chance to see the U.S. president in different environments and (literally) a different light. Here, Trump and his wife came out of the shadows to greet France's President Macron." Reuters/Jonathan Ernst Donald Trump's first year: in pictures Trump meets Putin at G20 summit - 7 July 2017 US President Donald Trump meets with Russian President Vladimir Putin during their bilateral meeting at the G20 summit in Hamburg, Germany on 7 July, 2017. Photographer Carlos Barria: "On July 7, I witnessed one of the most important meetings of President Trump's first year in office. Trump met Russian President Vladimir Putin during a bilateral meeting at the G20 summit in Germany. The world's eyes were on these two leaders after speculation about Russian interference during the 2016 US elections. We entered the room for less than two minutes, where I took dozens of pictures. But there was this very interesting moment when Trump extended his hand to Putin for a handshake. Putin paused for a second and looked at Trump's hand. That was the picture that I was looking for, a little moment that seemed to say a lot." Reuters/Carlos Barria Donald Trump's first year: in pictures First lady - 8 July 2017 First lady Melania Trump chats with US President Donald Trump during their return from Germany at Joint Base Andrews, Maryland on 8 July, 2017. Photographer Carlos Barria: "After President Trump's trip to Germany he arrived back at Joint Base Andrews, Maryland. First Lady Melania Trump said goodbye to Trump as she was heading off in a different direction that day. While chatting a breeze blew Melania's hair up in the air." Reuters/Carlos Barria Donald Trump's first year: in pictures Made in America product showcase - 17 July 2017 Vice President Mike Pence laughs as President Donald Trump holds a baseball bat as they attend a Made in America product showcase event at the White House on 17 July, 2017. Photographer Carlos Barria: "This summer the White House organized an event to showcase 'Made in America' products. All kinds of exhibitors brought their products as the President and Vice President toured the event. One of the companies was Marucci Sport, a manufacturer of baseball bats based in Baton Rouge, Louisiana. As Trump approached a table full of baseball bats, photographers at the event, including me, rushed to get a good angle hoping that he would pick up a bat. As we predicted, he did. He took one and joked around as though he was hitting something hard. The only thing closer to him right there, was the media." Reuters Donald Trump's first year: in pictures White House staffers - 25 July 2017 Former campaign manager Corey Lewandowski says hello to reporters as he and White House advisors including Communications Director Anthony Scaramucci accompany President Trump for an event celebrating veterans at AMVETS Post 44 in Ohio, July 25, 2017. Jonathan Ernst: "The most visible person in any White House is naturally the President, followed by the press secretary. But there are also the staff who support them. For those of us covering the Trump administration, there seem to be more compelling figures in the West Wing than ever before. It's crucial to know who's who and why they're important. When I raised my camera and back-pedalled ahead of the group to take this image Lewandowski gave me a hello. I liked the photo, but had no idea it would go a little bit viral, especially since Scaramucci, who was the biggest mover and shaker that week, was hidden back in the pack. But I guess the image catches a glimpse of what it's like to be a West Wing staffer on the road." Reuters/Jonathan Ernst Donald Trump's first year: in pictures Campaign rally - 3 August 2017 US President Donald Trump arrives at a rally in West Virginia on 3 August, 2017. Photographer Carlos Barria: "President Trump travelled to Huntington for one of his usual campaign rallies. While members of his family spoke to the crowd he was waiting under a black curtain to be introduced. Suddenly he walked onto the stage, one of the first frames that I took was of his hand. I set my exposure for the light on the stage hoping to create this dark background and it worked." Reuters/Carlos Barria Donald Trump's first year: in pictures Staring into the solar eclipse - 21 August 2017 Without his protective glasses on, US President Donald Trump looks up towards the solar eclipse while viewing with his wife Melania and son Barron at the White House on 21 August, 2017. Photographer Kevin Lamarque: "On a day when everyone, and I mean everyone, was told not to look at the eclipse without protective glasses, Trump, President of the United States, couldn't help himself." Reuters/Kevin Lamarque Donald Trump's first year: in pictures Hurricane Harvey - 2 September 2017 US President Donald Trump poses for a photo as he and first lady Melania Trump help volunteers hand out meals during a visit with flood survivors of Hurricane Harvey at a relief centre in Houston, Texas on 2 September, 2017. Photohrapher Kevin Lamarque: "Trump, eager to deliver the image of a hands-on response to Hurricane Harvey, made this visit to a relief centre and obliged this woman with a selfie as Melania continued to work." Reuters/Kevin Lamarque Donald Trump's first year: in pictures White House - 15 September 2017 Donald Trump welcomes 11-year-old Frank Giaccio as he cuts the Rose Garden grass at the White House on 15 September. Frank, who wrote a letter to Trump offering to mow the lawn, was invited to work for a day at the White House along the National Park Service staff. Frank was so focused on his task that he did not notice the President arrive to surprise him. He took his father jumping in to grab his attention and point Trump out. Photographer Carlos Barria said: “The image of Trump shouting at a kid who is mowing his lawn might have many interpretations in today's politically polarized United States. But for me it was just a kid who loved what he was doing, to the point he almost appeared to ignore the President." Reuters/Carlos Barria Donald Trump's first year: in pictures Take a knee - 27 September 2017 A man kneels with a folded U.S. flag as the motorcade of U.S. President Donald Trump passes him after an event at the state fairgrounds in Indianapolis, Indiana, U.S., September 27, 2017. In September, soon after Trump had made comments condemning NFL players who kneel during the national anthem, he made a day trip to a rally in Indianapolis. Jonathan Ernst managed to capture a man on one knee with a tri-folded flag and was able to use a portion of the sign on the building he was kneeling in front of to track the man down and tell his story in full. US Army veteran Marvin Boatright wanted to send a message against social injustice. Reuters/Jonathan Ernst Donald Trump's first year: in pictures Hurricane Maria - 3 October 2017 President Donald Trump throws rolls of paper towels into a crowd of local residents affected by Hurricane Maria as he visits Calgary Chapel in San Juan, Puerto Rico on 3 October, 2017. Photographer Jonathan Ernst: "During an afternoon visit to Puerto Rico for President Trump to survey damage from Hurricane Maria and greet some of its victims, Trump made a stop at a church where food and supplies were being distributed. Among the items were paper towels and Trump, apparently caught up in the moment, decided to distribute some of the rolls." Reuters Donald Trump's first year: in pictures Jared Kushner - 1 November 2017 White House Senior adviser Jared Kushner sits behind President Trump during a cabinet meeting in Washington on 1 November, 2017. Photographer Kevin Lamarque: "The role of Jared Kushner has gone through a series of changes. He began front and centre as a high profile adviser, but as time has passed and issues surrounding him have surfaced, he has become more of a background figure." Reuters/Kevin Lamarque Donald Trump's first year: in pictures Trump in China - 9 November 2017 Donald Trump and China's President Xi Jinping shake hands after making joint statements at the Great Hall of the People in Beijing on 9 November, 2017. Photographer Damir Sagolj: "It's one of those "how to make a better or at least different shot when two presidents shake hands several times a day, several days in row". If I'm not mistaken in calculation, presidents Xi Jinping and Donald Trump shook their hands at least six times in events I covered during Trump's recent visit to China. I would imagine there were some more handshakes I haven't seen but other photographers did. And they all look similar - two big men, smiling and heartily greeting each other until everyone gets their shot. But then there is always something that can make it special - in this case the background made of US and Chinese flags. The first time it didn't work for me. The second time I positioned myself lower and centrally, and used the longest lens I have to capture only hands reaching for a handshake." Reuters/Damir Sagolj Donald Trump's first year: in pictures Air Force One - 10 November 2017 US President Donald Trump boards Air Force One to depart for Vietnam from Beijing Airport in Beijing, China, November 10, 2017. Photographer Jonathan Ernst: "There is a Reuters photographer in the tight pool covering the US president for every appearance he makes 365 days a year. This was just one of 32 images of mine that were transmitted on the Reuters wire of President Trump visiting China and Vietnam that day. You never know when a sudden interaction, a gust of wind or a unique facial expression will lead to a striking image that grabs peoples' attention." Reuters/Jonathan Ernst Donald Trump's first year: in pictures ASEAN handshake - 13 November 2017 Donald Trump registers his surprise as he realises other leaders, including Russia's Prime Minister Dmitry Medvedev, Vietnam's Prime Minister Nguyen Xuan Phuc, President of the Philippines Rodrigo Duterte and Australia's Prime Minister Malcolm Turnbull, are crossing their arms for the traditional "ASEAN handshake" as he participates in the opening ceremony of the summit in Manila on 13 November, 2017. Photographer Jonathan Ernst: "Having covered a few ASEAN summits, I knew to expect the ASEAN handshake. Not everyone in the room knew to expect the ASEAN handshake. A lot was written about this unscripted moment, and what deeper meaning it might have. The simple truth is that sometimes in life there are unscripted moments." Reuters/Jonathan Ernst

House Democratic leader Nancy Pelosi has said Democrats will oppose the short-term spending bill.

In an attempt to deter Democrats from voting against it, Republican leaders had added a measure to the bill that would extend the children’s health insurance programme for six years. Democrats had fought to continue federal funding for the programme that serves nearly 9 million children. Federal financing for it expired in October and several states are close to exhausting their money.

If the spending bill passes in the House, it will then head to the Senate, where Democrats have already indicated they have enough support to block it.

Virginia’s two Democratic senators, Mark Warner and Tim Kaine – originally seen to be among the most likely ‘yes’ votes in the upper chamber – have announced their opposition.

Republican leaders need the support of at least nine Democratic senators for the bill to pass.

“Congress should remain in session with no recess until we work out a long-term bipartisan budget deal that addresses all issues,” Mr Warner and Mr Kaine said in a joint statement.

Over the past few weeks, several Democrats have made it clear they won’t be keen to vote for another spending measure unless they receive assurances that there will be a permanent legislative fix for the Deferred Action for Childhood Arrivals programme, or DACA. The programme, which expires in March, allowed young immigrants brought into the country illegally by their parents to secure work permits and deportation reprieves.

Negotiations on any immigration deal have been complicated by Mr Trump’s commitment to build a wall along the US’s southern border – a barrier that Democrats vehemently oppose and would cost billions of dollars to construct.