In this Friday, April 7, 2017, file photo, U.S. President Donald Trump, left, gestures as he and Chinese President Xi Jinping walk together at Mar-a-Lago in Palm Beach, Fla. AP

The US wants to secure a trade deal with China by year's end but can't overlook violence in Hong Kong, a senior official has said.

"We're not going to turn a blind eye to what's happening in Hong Kong," Robert O'Brien, the head of the National Security Agency, said Saturday.

Donald Trump said on Friday he warned Chinese President Xi Jinping that suppressing protests wil have "a tremendous negative impact" on attempts to end the trade war, now into its 16th month.

Trump also said he could veto bipartisan US legislation that outlined support for pro-democracy protests in Hong Kong, suggesting it will anger China and derail trade talks.

Visit Business Insider's homepage for more stories.

The US wants to ink a trade deal with China by the end of 2019, but can't overlook violence in Hong Kong, the head of the National Security Agency has said.

"We were hoping to have deal done by the end of the year. I still think that's possible," Robert O'Brien said during a security conference in Halifax, Nova Scotia, on Saturday.

"At the same time, we're not going to turn a blind eye to what's happening in Hong Kong or what's happening in the South China Sea, or other areas of the world where we're concerned about China's activity."

O'Brien, Donald Trump's fourth security advisor, said it "would be a good sign" if Sunday's local elections in Hong Kong passed without clashes between pro-democracy protesters and police.

A protester makes a gesture during a protest in Hong Kong on June 12, 2019. Anthony Kwan/Getty Images

Trump says he has warned Chinese President Xi Jinping that suppressing protests in Hong Kong wil have "a tremendous negative impact" on attempts to end the trade war, now into its 16th month.

In an interview with Fox & Friends on Friday, Trump said that if it weren't for him, "Hong Kong would have been obliterated in 14 minutes."

He said that Xi had "a million soldiers standing outside of Hong Kong that aren't going in only because I asked him, 'please don't do that.'"

Republican presidential candidate Donald Trump participates in a debate sponsored by Fox News at the Fox Theatre on March 3, 2016 in Detroit, Michigan Chip Somodevilla/Getty Images

Trump also said he could veto bipartisan US legislation, passed on Wednesday, that outlined support for pro-democracy protests in Hong Kong, suggesting it will anger China and derail trade talks.

"We have to stand with Hong Kong, but I'm also standing with President Xi. He's a friend of mine, an incredible guy."

NOW WATCH: Popular Videos from Insider Inc.