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

Michael Cohen, President Donald Trump's former personal lawyer and fixer, confirmed on Thursday that he paid a small tech firm to rig online polls before the 2016 presidential campaign got underway "at the direction of and the sole benefit of" Trump.

The Wall Street Journal was the first to report the payment and attempted poll manipulation. The Trump Organization declined to comment to the newspaper.

"As for the @WSJ article on poll rigging, what I did was at the direction of and for the sole benefit of @realDonaldTrump @POTUS. I truly regret my blind loyalty to a man who doesn’t deserve it," Cohen said in a tweet.

Cohen paid the money to John Gauger, who runs RedFinch Solutions LLC, in early 2015, to rig online polls in Trump’s favor before the presidential campaign.

The newspaper reported that Cohen gave Gauger a blue Walmart bag containing about $13,000 in cash. Gauger also said that Cohen randomly included a boxing glove Cohen claimed at the time had been worn by a Brazilian mixed-martial arts fighter.

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

However, in a statement to the Journal, Cohen said he did not pay Gauger in cash.

“All monies paid to Mr. Gauger were by check,” Cohen told the newspaper, without offering further details to the newspaper.

Gauger, who is also chief information officer at Liberty University in Virginia, where evangelical leader and Trump supporter Jerry Falwell Jr. is president, said he was supposed to be paid $50,000 for the project but never received the remaining money. Trump, however, reimbursed Cohen in early 2017 for $50,000 for the work, the Journal reported, citing a government document and a person familiar with the matter.

Rudy Giuliani, a personal lawyer for Trump, said in a statement to the Journal that Cohen is “untrustworthy” because he was reimbursed more money than he paid RedFinch.

“If one thing has been established, it’s that Michael Cohen is completely untrustworthy,” Giuliani said.

When Cohen asked for the $50,000 reimbursement, he cited technology services but did not tell Trump Organization executives what services specifically were performed, the Journal reported, citing people familiar with the matter.

Trevor Potter, a campaign finance lawyer and former chairman of the Federal Election Commission, told NBC News that Cohen's payment to the tech firm should have been accounted for and disclosed in campaign reports because Trump was "testing the waters" for a White House bid at the time, meaning exploring a candidacy but not yet declared. A search of FEC records showed no indication of a disclosure.

“Once he became a candidate, this should have been reported as an in-kind contribution to the campaign, because it is required to report all testing expenditures and contributions on its initial FEC reports upon qualifying as a candidate," Potter said.

Brendan Fischer, director of the Campaign Legal Center's federal reform program, also said the payments needed to be reported as soon as Trump declared his candidacy in June 2015. However, building a case against Cohen for these potential campaign finance violations would have been much more difficult than the case made over hush payments Cohen facilitated to women who alleged affairs with Trump, Paul S. Ryan, vice president for policy and litigation at the watchdog group Common Cause, tweeted.

Cohen was sentenced in December to three years in prison for what a Manhattan federal court judge called a “veritable smorgasbord" of criminal conduct, including making those secret payments, lying to Congress about the president’s business dealings with Russia, and failing to report millions of dollars in income.

Shortly after being sentenced, Cohen told ABC's "Good Morning America" he knew what he was doing was wrong and refuted Trump's claim that he "never directed Michael Cohen to break the law."

Cohen is slated to testify publicly before Congress early next month before he goes to prison. Cohen said he agreed to appear before the House Oversight Committee on Feb. 7 "in furtherance of my commitment to cooperate and provide the American people with answers."