Republican Sen. Rand Paul was once one of President Donald Trump's most prominent GOP critics, particularly during the 2016 presidential election.

But in recent months he's become one of the president's biggest allies on issues relating to Russia.

During a visit to Moscow on Monday, Paul invited Russian lawmakers to visit Washington, DC, expanding on Trump's efforts to improve US-Russia relations.

Paul says his stance on Russia is simply about encouraging dialogue.

Republican Sen. Rand Paul was once one of President Donald Trump's staunchest critics, particularly during the 2016 presidential election. But in recent months he's become one of his biggest allies on issues relating to what has been a constant thorn in the president's side: Russia.

In the latest example, during a trip to Moscow on Monday, Paul invited Russian lawmakers to visit Washington, DC, expanding on Trump's efforts to improve US-Russia relations.

"I am pleased to announce that we will be continuing this contact," the Kentucky Republican said in Moscow. "We agreed and we invited members of the Foreign Affairs Committee of Russia to come to the US to meet with us in the US, in Washington."

Over the past several weeks, Paul has transitioned from someone who once said a "speck of dirt" would be more qualified to be president than Trump, to backing him on one of the most touchy subjects in politics today.

Paul cheered Trump's meeting with Putin

Paul's invitation and visit to the Russian capital came several weeks after Trump's summit with Russian President Vladimir Putin in Helsinki, Finland, during which Trump appeared to side with the Russian leader over the US intelligence community on the Kremlin's interference in the 2016 election.

Trump faced sharp criticism from politicians on both sides of the aisle for his remarks in Helsinki. But Paul, who during the 2016 campaign characterized Trump as a "delusional narcissist and an orange-faced windbag," was one of the only figures in Washington who defended the president.

"I think engagement with our adversaries, conversations with our adversaries, is a good idea," Paul said during an interview with CNN anchor Wolf Blitzer in mid-July.

"Even in the height of the Cold War, I think it was a good thing that" President John F. Kennedy "had a direct line to" Soviet leader Nikita Khrushchev, Paul said.

Paul has also been highly critical of the special counsel Robert Mueller's investigation into Russian election interference and whether anyone in the Trump campaign colluded with Russian officials.

The Kentucky senator has taken up Trump's favorite line of argument on the Mueller probe, describing it as a "witch hunt" against the president during a CNN interview that occurred less than 48 hours after Mueller announced indictments again 12 Russian intelligence officers as part of the investigation.

Meanwhile, Trump has thanked Paul via Twitter for his criticism of the Mueller investigation in recent weeks.

Paul says he wants to encourage dialogue

"We had general discussions about a lot of issues and basically we've decided that right now we will try to do is establish a dialogue and solve issues," Paul told CNN on Monday of his conversations with Russian lawmakers.

Paul added: "Your biggest issue right now there is no dialogue, issues that we can't even have discussion about because we have no dialogue."

While in Moscow on Monday, Paul reportedly told Russian lawmakers that the president's "hands are tied behind his back" when it comes to US-Russia relations, adding, "[Trump] can't advocate for greater cooperation between our countries. Because all this will look like: 'Oh, you love Russia!'"

Paul also seems to have delivered a message from Trump to Putin.

On Wednesday, the senator tweeted, "I was honored to deliver a letter from President Trump to President Vladimir Putin’s administration. The letter emphasized the importance of further engagement in various areas including countering terrorism, enhancing legislative dialogue and resuming cultural exchanges."

Paul has a history of going against the grain in Washington

In many ways, Paul's unorthodox stance on Russia falls in line with his long history of contrarian behavior in Washington.

When it comes to foreign policy, for example, Paul has often been decidedly more isolationist than his GOP counterparts, which has led him to align with Trump on some issues relating to his "America First" policies while rejecting the more neoconservative wing of the party.

During the Obama administration, for instance, he attained national prominence when he filibustered the nomination of John Brennan to run the CIA. Paul, who has continued to be critical of US intelligence agencies, recently suggested that former intelligence officials be stripped of their security clearance, including Brennan. Just hours later, the White House announced Trump was looking into doing that.

After meeting with Russian lawmakers on Monday, Paul said Russia shouldn't necessarily be considered a "friend" to the US, but emphasized the country's "shared interests" on issues such as "Syria, terrorism, and energy."

'The senator from Kentucky is now working for Vladimir Putin'

In the wake of Russia's annexation of Crimea in 2014, Paul called for the US to isolate Russia if it continued to act like a "rogue nation."

"It is important that Russia become economically isolated until all its forces are removed from Crimea and Putin pledges to act in accordance with the international standards of behavior that respect the rights of free people everywhere," Paul wrote in March 2014.

Yet he also urged that the US stay out of the conflict militarily, saying it was not time for "politicians who have never seen war talking tough for the sake of their political careers."

Paul has more recently downplayed Russian election interference and has defied much of the party line on measures to hold the country accountable.

Paul, for example, was one of only two senators to vote against imposing new sanctions against Russia in June 2017. Moreover, as he visited Moscow this week, Paul told Russian lawmakers he'd vote against new sanctions against Russia proposed by his colleagues in the Senate.

Last March, Republican Sen. John McCain accused Paul of "working for Vladimir Putin" after Paul objected to a resolution regarding Montenegro's ascension to NATO.

"The senator from Kentucky is now working for Vladimir Putin," McCain said at the time.