AT&T CEO Randall Stephenson said hiring President Donald Trump's personal lawyer as a consultant was "a big mistake," according to a company memo sent on Friday.

The telecom giant hired attorney Michael Cohen, who has worked for Trump in a personal role for years, for advice on its pending merger with Time Warner. The company has said it paid Cohen $600,000 to gain "insights" into the president's thinking. The memo was first reported by Reuters.

In the employee memo, Stephenson admitted hiring Cohen's firm was an error.

"There is no other way to say it — AT&T hiring Michael Cohen as a political consultant was a big mistake," Stephenson wrote. "To be clear, everything we did was done according to the law and entirely legitimate. But the fact is our past association with Cohen was a serious misjudgment."

AT&T also announced that its top lobbyist, Bob Quinn, who hired Cohen, is retiring. A source familiar with the situation told NBC News that Quinn's retirement is "clearly in relation to this situation."

AT&T said the department that had been led by Quinn would now be overseen by the company's general counsel.

"In this instance, our Washington, D.C., team's vetting process clearly failed, and I take responsibility for that," Stephenson wrote in the memo.

Randall Stephenson, Chief Executive Officer (CEO) of ATT and Bob Quinn, ATT Senior Executive Vice President arrive for a meeting with U.S. President-elect Donald Trump at Trump Tower in New York Jan. 12, 2017. Mike Segar / Reuters file

A spokesperson for AT&T declined to respond to questions about the memo.

AT&T is currently in a precarious public relations situation because it is awaiting government approval to finalize its $85 billion acquisition of Time Warner.

The Justice Department sued to block the merger, and AT&T is awaiting U.S. District Judge Richard Leon’s ruling on whether the acquisition can proceed. His decision is expected on June 12.

AT&T has been on the defensive since Michael Avenatti, a lawyer for adult film actress Stormy Daniels, revealed the company had paid Cohen through Essential Consulting, a company Cohen set up in October 2016.

Essential Consulting then made a $130,000 payment to Daniels to stop her from publicly claiming that she had a sexual encounter with Trump in 2006.

In the memo, AT&T said it had hired several consultants to “help us understand how the president and his administration might approach a wide range of policy issues important to the company, including regulatory reform at the FCC, corporate tax reform and anti-trust enforcement.”

Cohen did no legal or lobbying work, the company said, and the contract ended in December 2017.

The Washington Post reported on Thursday that Cohen had in fact offered to advise on the Time Warner merger.

AT&T isn’t the only firm to express regret at having gotten entangled with Cohen. The drug company Novartis said on Thursday that it was wrong to have agreed to pay Cohen $1.2 million for advice on health care policy.

“We made a mistake in entering into this engagement and, as a consequence, are being criticized by a world that expects more from us," Vasant Narasimhan, chief executive of Novartis, wrote in an email to employees.

The FBI raided the office and hotel room of Cohen last month, seizing documents as part of a search for information about the $130,000 payment made to Daniels.

Avenatti, the lawyer for Daniels, said in a phone interview that he expects more companies and consultants close to Trump to be uncovered.

"I think this will be the first of many acknowledgements from various entities and individuals who attempted to buy influence with the president,” Avenatti said. “Sunlight is said to be the very best of disinfectant, and we're going to continue to bring sunlight."