President Donald Trump on Tuesday suggested the US federal government could use a shutdown in September to fix what he called a "mess" in Congress.

On Twitter, Trump explained why Republicans struck a deal with Democrats on a bill to keep the government funded until September 30.

"The reason for the plan negotiated between the Republicans and Democrats is that we need 60 votes in the Senate which are not there!" Trump tweeted.

Democrats could have held up any deal in the Senate with a filibuster, since Republicans have only a 52-seat majority and would need 60 votes to move legislation forward.

Because of this political reality, many of Trump's wish-list items — funding for a US-Mexico border wall, defunding Planned Parenthood, and withholding funding from so-called sanctuary cities — were dropped from the spending agreement.

Trump suggested that to secure more victories in the next funding legislation, Republicans either needed to win more seats or get rid of the legislative filibuster.

"We either elect more Republican Senators in 2018 or change the rules now to 51%," Trump said.

Republicans last month eliminated the judicial filibuster for Supreme Court nominees during the confirmation of Justice Neil Gorsuch, but lawmakers seem reluctant to do the same with legislation.

The president concluded by saying the government needed "a good 'shutdown' in September to fix mess!"

Here are Trump's tweets: