The United States won't waver in its commitment to NATO and Baltic security, Sen. John McCain said Tuesday in Estonia, where he's seeking to soothe anxiety over President-elect Donald Trump's rhetoric.

McCain told reporters that he and Estonia's leaders discussed the outcome of American election, which he conceded came as a surprise after Democratic candidate Hillary Clinton polled so well in the weeks leading up to the vote.

"But I am convinced and certain that our relationship and [...] the American relationship with NATO, will remain the same," he said.

"I think the presence of the American troops here in Estonia is a signal that we believe in what Ronald Reagan believed, and that is peace through strength," McCain added from Tallinn, the Estonian capital. "And the best way to prevent Russian misbehavior by having a credible, strong military and a strong NATO alliance."

Related: Donald Trump Remarks on NATO Trigger Alarm Bells in Europe

While on the campaign trail, Trump raised alarm bells in Estonia, Lithuania, and Latvia when he suggested the U.S. would not necessarily defend new NATO members in the Baltics in the event of a Russian attack. He told The New York Times that it would depend on whether those countries had "fulfilled their obligations to us" in terms of financial contributions to the NATO alliance.

Senator John McCain attends a joint press conference with Estonian President Juri Ratas in Tallinn, Estonia, on Tuesday. Senior Republican senators are meeting with heads of state and top defence officials in Estonia to discuss regional security and NATO plans in Estonia. VALDA KALNINA / EPA

On his three-day visit to the Baltics, McCain, accompanied by fellow Republican senator Lindsey Graham, assured the countries that regardless of who is president, the U.S. would have "a strong and significant response" as long as Putin continued "to occupy Crimea and ... continues to threaten other nations in the region."

The U.S. has had about 150 troops in each of the three Baltic countries plus Poland since April 2014. Russia annexed Crimea in 2014, a move that stoked fears that Moscow would someday try to exercise control over the entire region.

Related: U.S. Officials: Putin Personally Involved in U.S. Election Hack

The U.S. imposed sanctions against Russia after the annexation. McCain said Tuesday he didn't expect the sanctions to be removed.

"That is certainly not the case today as I know it," he said.

McCain and Graham will travel to Latvia on Wednesday and Lithuania on Thursday. They have called for a bipartisan panel to investigate cyber attacks against the U.S. and Russia's alleged attempts to interfere in the U.S. presidential election.

McCain said Tuesday that while there was no doubt that Russians were hacking the U.S., it wasn't clear whether that affected the outcome of the election.