President Donald Trump signed legislation Wednesday that slaps sanctions on Russia and limits his own ability to create waivers - but at the same time issued a furious statement calling it 'flawed'.

He signed the bill, which Secretary of State Rex Tillerson publicly said he wasn't happy about, in private.

Then the White House sent out statement by the president revealing the depths of his unhappiness and boasting that his billions showed he was far better at deal-making than Congress.

Trump said despite some changes, 'the bill remains seriously flawed – particularly because it encroaches on the executive branch's authority to negotiate.'

He called parts of it 'unconstitutional' and signaled fresh tensions with Republicans by criticizing their failure to repeal and replace Obamacare.

President Donald Trump has signed legislation that slaps sanctions on Russia and limits his own ability to create waivers

He attached his name to it anyway, 'in the interest of national unity,' the White House said Wednesday afternoon.

'The president favors tough measures to punish and deter the bad behavior of the rogue regimes in Iran and North Korea,' White House Press Secretary Sarah Huckabee Sanders told reporters, 'and he also sent a clear signal that we won't tolerate interference in our democratic process by Russia.'

Trump also said in a lengthy press statement that the White House sent out alongside a formal signing statement that he was 'signing this bill for the sake of national unity.'

'Congress could not even negotiate a healthcare bill after seven years of talking. By limiting the Executive's flexibility, this bill makes it harder for the United States to strike good deals for the American people, and will drive China, Russia, and North Korea much closer together,' he said.

'The Framers of our Constitution put foreign affairs in the hands of the President. This bill will prove the wisdom of that choice,' Trump said in the statement.

Trump said the legislation 'represents the will of the American people to see Russia take steps to improve relations with the United States.

'We hope there will be cooperation between our two countries on major global issues so that these sanctions will no longer be necessary.'

In a message to Congress in response to the bill, Trump singled out provisions his lawyers considers in conflict with Supreme Court case law – and asserts his own latitude to carry out the law as he sees fit.

'My Administration will give careful and respectful consideration to the preferences expressed by the Congress in these various provisions,' the president said in one point – in language certain to irk lawmakers who consider the law much more than a preference.

Secretary of State Rex Tillerson said Trump wasn't happy with the bill

'My administration ... expects the Congress to refrain from using this flawed bill to hinder our important work with European allies to resolve the conflict in Ukraine, and from using it to hinder our efforts to address any unintended consequences it may have for American businesses, our friends, or our allies,' he said.

The president also complained about what he said were 'clearly unconstitutional provisions' in the legislation relating to presidential powers to shape foreign policy.

White House counselor Kellyanne Conway confirmed the signing on Fox News.

The bill passed Congress by overwhelming margins sufficient to override a presidential veto. Trump could have allowed the bill to become law without his signature, but decided against it.

The White House had lobbied to water down restrictions in the bill.

It contains language meant to prevent the president from lifting them without approval from Congress – provisions that got drafted amid concerns Trump would lift or limit sanctions amid his frequent praise for Russian President Vladimir Putin and desire to improve ties between the two powers.

Tillerson told reporters he shared misgivings with the president, as they try to improve relations with Russia.

'Neither the president nor I are very happy about that,' Tillerson said. 'We were clear that we didn't think that was going to be helpful to our efforts, but that's the decision they made.'

SIGN OF THE TIMES: Russian President Vladimir Putin speaks during a news conference after the G20 summit in Hamburg, northern Germany, July 8, 2017

Then-candidate Donald Trump holds up a signed pledge during a press availability at Trump Tower in Manhattan, New York September 3, 2015

Justice Department lawyers and security officials were reviewing Russia sanctions legislation Tuesday

The FBI and congressional intelligence panels are probing Trump campaign connections to Russians during the election.

Trump during the campaign called repeatedly for better relations with Russia. The U.S. intelligence community concluded that the Russian government backed a campaign to interfere in the presidential election.

Despite communications with Russian President Vladimir Putin capped off by two one-on-one meetings in Europe, Trump has struggled to meet his goal.

Putin said last weekend that Russia would expel more than 700 U.S. diplomats from Russia in retaliation for the sanctions legislation.

A report said Wednesday that Trump had talked to Putin on the phone before he put pen to paper, but Huckabee Sanders told reporters it was incorrect.

In his statement about the bill, Trump highlighted a series of concerns about the legislation.

'Since this bill was first introduced, I have expressed my concerns to Congress about the many ways it improperly encroaches on Executive power, disadvantages American companies, and hurts the interests of our European allies,' Trump complained.

I'M WORTH BILLIONS - I CAN MAKE BETTER DEALS THAN CONGRESS Today, I signed into law the 'Countering America's Adversaries Through Sanctions Act,' which enacts new sanctions on Iran, North Korea, and Russia. I favor tough measures to punish and deter bad behavior by the rogue regimes in Tehran and Pyongyang. I also support making clear that America will not tolerate interference in our democratic process, and that we will side with our allies and friends against Russian subversion and destabilization. That is why, since taking office, I have enacted tough new sanctions on Iran and North Korea, and shored up existing sanctions on Russia. Since this bill was first introduced, I have expressed my concerns to Congress about the many ways it improperly encroaches on Executive power, disadvantages American companies, and hurts the interests of our European allies. My Administration has attempted to work with Congress to make this bill better. We have made progress and improved the language to give the Treasury Department greater flexibility in granting routine licenses to American businesses, people, and companies. The improved language also reflects feedback from our European allies – who have been steadfast partners on Russia sanctions – regarding the energy sanctions provided for in the legislation. The new language also ensures our agencies can delay sanctions on the intelligence and defense sectors, because those sanctions could negatively affect American companies and those of our allies. Still, the bill remains seriously flawed – particularly because it encroaches on the executive branch's authority to negotiate. Congress could not even negotiate a healthcare bill after seven years of talking. By limiting the Executive's flexibility, this bill makes it harder for the United States to strike good deals for the American people, and will drive China, Russia, and North Korea much closer together. The Framers of our Constitution put foreign affairs in the hands of the President. This bill will prove the wisdom of that choice. Yet despite its problems, I am signing this bill for the sake of national unity. It represents the will of the American people to see Russia take steps to improve relations with the United States. We hope there will be cooperation between our two countries on major global issues so that these sanctions will no longer be necessary. Further, the bill sends a clear message to Iran and North Korea that the American people will not tolerate their dangerous and destabilizing behavior. America will continue to work closely with our friends and allies to check those countries' malignant activities. I built a truly great company worth many billions of dollars. That is a big part of the reason I was elected. As President, I can make far better deals with foreign countries than Congress. Advertisement

'My Administration has attempted to work with Congress to make this bill better. We have made progress and improved the language to give the Treasury Department greater flexibility in granting routine licenses to American businesses, people, and companies,' he contended.

'The improved language also reflects feedback from our European allies – who have been steadfast partners on Russia sanctions – regarding the energy sanctions provided for in the legislation. The new language also ensures our agencies can delay sanctions on the intelligence and defense sectors, because those sanctions could negatively affect American companies and those of our allies.'

Russia hawk Sen. John McCain of Arizona responded in a statement that said: 'I welcome President Trump's decision to sign legislation imposing new sanctions on Russia, Iran, and North Korea.

'The enactment of this legislation, which enjoyed overwhelming bipartisan support in both houses of Congress, sends a strong message to friend and foe alike that the United States will hold nations accountable for aggressive and destabilizing behavior that threatens our national interests and those of our allies and partners.'

McCain also called the concerns that Trump outlined in his press statement 'hardly surprising, though misplaced.'

'The Framers of our Constitution made the Congress and the President coequal branches of government. This bill has already proven the wisdom of that choice,' he wrote.

'While the American people surely hope for better relations with Russia, what this legislation truly represents is their insistence that Vladimir Putin and his regime must pay a real price for attacking our democracy, violating human rights, occupying Crimea, and destabilizing Ukraine.'

Trump signed the bill behind closed doors without a ceremony of any kind.

The decision reflected difficult position the sanctions legislation put him in – and his misgivings about signing it. The secretive nature of it contrasted to even minor legislation Trump has out his name on. In June, he even held a ceremony for a non-binding proposal to privatize air traffic control. At that event, he invited lawmakers and handed out the signing pen.

Huckabee Sanders denied that the president was 'pressured' into signing the sanctions bill on Wednesday as she faced reporters.

'No, as I've said the president supports putting pressure on these three countries in particular and so he supports the principle of it and wanted to take action in that course,' she asserted.