Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

WASHINGTON — President Donald Trump signed a bill on Wednesday imposing new sanctions on Russia, putting to rest questions about whether he would support the legislation passed overwhelmingly by Congress last week. Nonetheless, he still excoriated the measure as "significantly flawed."

The bill sanctions Russia — citing its cyberhacking as well as aggression in Ukraine and Syria — while also slapping new sanctions on North Korea and Iran.

The legislation limits the ability of the president to lift the sanctions unilaterally, something lawmakers had insisted on.

Trump signed the bill behind closed doors, with no press coverage. In one White House statement released after the signing, referred to as the "official signing statement," the president called some of the provisions "clearly unconstitutional."

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

In a second statement, Trump lamented that the bill "encroaches on the executive branch's authority to negotiate."

"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, adding that he signed legislation "for the sake of national unity."

That statement goes on to chastise Congress for an entirely different issue — its inability to "negotiate a healthcare bill after seven years of talking" — and finishes with a personal note: "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."

Related: Read the President's Entire Statement on the Sanctions

Secretary of State Rex Tillerson told reporters Tuesday that neither he nor President Trump, "were very happy" about the way Congress put these new sanctions in place, but he anticipated the bill would be signed anyway.

"We were clear that we didn't think it was going to be helpful to our efforts, but that's the decision they made, they made it in a very overwhelming way. I think the president accepts that," he said.

The sanctions bill was passed in both chambers of Congress with strong bipartisan support and by veto-proof margins. It passed in the Senate on Thursday with a 98-2 vote and in the House last Tuesday, 419-3.

Lawmakers pushed the sanctions, particularly those against Russia, in spite of the president's conciliatory tone toward the country whose government U.S. intelligence agencies concluded meddled in the 2016 presidential election. Russian government officials, including President Vladimir Putin, have denied the allegations, both in the press and to Trump directly.

Trump has hedged repeatedly on the question of Russian responsibility for election meddling last year, saying it is possible Russia was involved but other countries could have had a role.

Putin voiced his objection to the proposed sanctions last week, accusing the U.S. of attempting to use "geopolitical advantages in competition to pursue economic interests at the expense of [U.S.] allies."