Updated at 2:15 p.m.: Revised to include new Trump comment.

WASHINGTON — President Donald Trump threatened Friday to veto a bill denouncing the crackdown on pro-democracy protests in Hong Kong, citing implications for trade talks with China and boasting that he has already saved thousands of lives by pressuring Beijing to show restraint.

The stance put him squarely at odds with nearly everyone in Congress, perhaps most notably Sen. Ted Cruz, a close ally who has traveled to Hong Kong last month to show solidarity with anti-government demonstrators and crusaded for a robust U.S. response.

“We have to stand with Hong Kong, but I’m also standing with President Xi [Jinping],” Trump said on Fox & Friends. “He’s a friend of mine. He’s an incredible guy. … I stand with freedom, I stand with all of the things that I want to do, but we are also in the process of making one of the largest trade deals in history."

Trump insisted that the pressure he has put on Xi has staved off a military response to the protests.

“If it weren’t for me, thousands of people would have been killed in Hong Kong right now. And you wouldn’t have any riots. You’d have a police state. ... The only reason he’s not going in is because I’m saying, `It’s going to affect our trade deal, you don’t want to do that,' ” Trump said.

On Tuesday, the Senate approved the Hong Kong Human Rights and Democracy Act on a unanimous vote. The House approved it the next day 417 to 1.

In response to Trump’s threat, Cruz vowed that Congress will override any veto.

“President Xi and the Chinese Communist Party cannot silence the United States Congress. In case they aren’t familiar with how our Constitution works, the Hong Kong Human Rights and Democracy Act passed the House and Senate by overwhelming veto-proof majorities and it will become law. This was a true bipartisan moment and a clear signal to the rest of the world that political threats from corrupt regimes will not stand in the way of America supporting the millions of freedom fighters in Hong Kong,” he said.

Trump’s opposition to the measure could strain his roller-coaster relationship with the Texan. They were bitter rivals during the 2016 primary campaign but since Trump took office, Cruz has emerged as a top supporter on a range of policies.

The bill authorizes sanctions on Chinese and Hong Kong officials involved in human rights abuses. Chinese officials have denounced the measure as meddling in their country’s internal affairs.

Trump’s assessment that it would complicate trade talks is widely held. But Cruz and others view that consideration as secondary given the heavy-handed tactics in Hong Kong and the steady erosion of freedoms since the United Kingdom handed over the territory in 1997.

Trump asserted repeatedly that he deserves credit for deterring Xi from unleashing a far more lethal response.

“If it weren’t for me, Hong Kong would have been obliterated in 14 minutes. He’s got a million soldiers standing outside of Hong Kong that aren’t going in only because I ask him, `Please don’t do that. You’ll be making a big mistake. It’s going to have a tremendous negative impact on the trade deal,’ ” he said on Fox. Asked Friday afternoon at the White House whether he will sign the bill, he told reporters: “It’s being sent over. We’re going to take a very good look at it.”

A man is escorted by the police after a pro-democracy rally in the Mong Kok district in Hong Kong on October 27, 2019. Police fired tear gas and rubber bullets at protesters who defied authorities to hold a rally on Hong Kong's scenic harbor front, another flashpoint in months of political unrest gripping the city. (PHILIP FONG / AFP via Getty Images)

Policed fired tear gas as protesters attempted to march toward Hong Kong Polytechnic University on Nov. 18, 2019. Dozens of protesters escaped a two-day police siege at the campus by shimmying down a rope from a bridge to awaiting motorbikes. (DALE DE LA REY / AFP via Getty Images)

On the Senate floor on Tuesday, Cruz argued for a public renunciation by the U.S. government.

“The police brutality that we have seen and the Chinese Communist Party’s larger assault on the people of Hong Kong has been shameful,” he said, noting that last weekend police used tear gas and rubber bullets on university students “peacefully protesting that brutality,” turning their campus into a “war zone, where no one was safe.”

“Today,” he said, “we have the opportunity to tell the world, these blatant human rights attacks and this campaign to bully Hong Kong into submission are not OK and America won’t stand for it.”

Sen. Chuck Schumer of New York, the Democratic minority leader, blasted Trump for being out of step with American sentiment on “President Xi’s oppressive policies toward the people of Hong Kong. For a guy who promised to be tough on China, President Trump’s reliable deference to President Xi is all the more bewildering. Being tough on China when it comes to human rights will also help us win the battle on trade."

Trump made his comments Friday during a wide-ranging phone interview with Fox that lasted over 50 minutes, at the end of a week of damaging testimony in House impeachment hearings, supporting allegations that he tried to use military aid and a White House meeting as leverage against Ukraine, in exchange for political favors.

He insisted that “I want a trial" if House Democrats vote to impeach — not that he would have a choice. A Senate trial would be mandatory.

Trump said he would seek trial testimony from Rep. Adam Schiff, D-Calif., who has led the impeachment hearings as chairman of the Intelligence Committee, and from the anonymous whistleblower whose complaint triggered the probe and whose allegations have subsequently been confirmed by a parade of on-the-record testimony from National Security Council and State Department officials.

He also attacked Marie Yovanovitch, the former ambassador to Ukraine whom he fired in May after a prolonged smear campaign that involved his personal lawyer, Rudy Giuliani.

President Donald Trump talks to the media during the NCAA Collegiate National Champions Day event at the White House on Nov. 22, 2019. (Evan Vucci / AP)

He called her “an Obama person,” although she was not a political appointee but rather a career State Department official who had served administrations of both parties. He asserted that during her tenure in Kyiv, she refused to display his presidential portrait, as is customary at federal buildings around the world.

“She wouldn't hang my picture in the embassy,” he claimed. “She's in charge of the embassy, it took, like, a year and a half, two years."

That claim has not previously been leveled and it’s unclear if it was true.

“This was not an angel, this woman, and okay, there were a lot of things she did that I didn’t like. But I just want you to know, this is not a baby we’re dealing with,” Trump said.

Trump defended his decision to empower Giuliani to run a shadow foreign policy in Ukraine — influence he used to force out Yovanovitch because she stood in the way of efforts to force Ukraine’s new government to launch an unfounded corruption probe aimed at Joe Biden, a Democratic rival running for president.

“Rudy is a great crime fighter,” Trump said, calling the former U.S. attorney and New York mayor “a very legendary figure in our country.”