GENEVA — Swiss pharmaceutical giant Novartis said Wednesday that its top lawyer is retiring over a deal to hire U.S. President Donald Trump's personal lawyer, Michael Cohen, as a consultant.

The Basel-based company said general counsel Felix Ehrat is stepping down after about seven years in post "in the context of discussions surrounding Novartis' former agreement with Essential Consultants, owned by Michael Cohen."

"Although the contract was legally in order, it was an error," Ehrat said in a statement, adding that he took "personal responsibility to bring the public debate on this matter to an end."

Company spokesman Eric Althoff said last week that Novartis had entered into a one-year agreement with Essential Consultants in February 2017 — a month after Trump's inauguration — to focus on health care policy.

Althoff said Novartis had hired Cohen for $100,000 per month, but determined after a single meeting with him that he wouldn't be of use. The company still paid out the $1.2 million contract.

Novartis said Shannon Thyme Klinger, who graduated from the University of North Carolina law school and who is now the company's ethics, risk and compliance officer, will take over from Ehrat as general counsel on June 1.

The move comes five days after AT&T said its chief lobbyist was leaving the company after overseeing a $50,000-per-month contract for Cohen to serve as a consultant for a year.

President Donald Trump's personal lawyer, Michael Cohen, exits a hotel in New York City on April 13, 2018. Jeenah Moon / Reuters file

In a memo to employees, AT&T CEO Randall Stephenson had said the company made a "big mistake" in hiring Cohen as a consultant. While everything the company did was legal, Stephenson said that the association with Cohen was "a serious misjudgment."

Stephenson noted that the company's reputation has been damaged and that the vetting process used by its team in Washington "clearly failed."

Stephenson said Bob Quinn, senior executive vice president of the external and legislative affairs group, "will be retiring."

The Justice Department is seeking to block AT&T's $85 billion purchase of Time Warner on the grounds that it would stifle competition. AT&T disagreed, sending the battle into a federal trial. U.S. District Judge Richard Leon is expected to rule next month.

AT&T said Cohen approached the company after the 2016 presidential election and said he was leaving the Trump organization to do consulting for a "select few" companies that wanted his opinion on Trump and the administration.