By Liz Hoffman 

A Pennsylvania judge recommended that Kirkland & Ellis LLP be prevented from advising Teva Pharmaceutical Industries Ltd. on its attempted takeover of Mylan NV after the law firm had earlier represented Mylan on other matters.

Citing "the critical importance of every attorney's duty of 'undivided loyalty,'" the judge held that Kirkland's earlier work for Mylan on drug approvals and other matters should bar the law firm from advising Teva, which has made a $40 billion unsolicited offer for its smaller rival but has been rejected.

"It would be hard to imagine a representation more opposed to a current client's interests, more in breach of a fiduciary duty toward those interests, than...a hostile takeover attempt of the clients' entire corporate affiliate group," the judge wrote.

The report, issued late Tuesday, could shake up a bitter, three-way takeover battle. Mylan has rejected Teva's bid in unusually harsh terms and is instead forging ahead with its own, twice-rejected offer for Perrigo Co.

In the wake of the ruling, Teva has retained Sullivan & Cromwell LLP to advise it going forward, a spokeswoman confirmed.

A Kirkland spokesman said the firm planned to file a formal objection.

"The scope of Kirkland's legal work for certain Mylan subsidiaries is narrowly limited to discrete FDA administrative law issues, and Kirkland has never represented the parent company," he said. "Mylan's lawsuit is nothing more than a tactical ploy designed to impede a proposed transaction with Teva."

He also said Kirkland has a waiver from Mylan to take on projects against it. Mylan has disputed the waiver's scope, and the judge largely said it didn't apply because Kirkland's work for Mylan was sufficiently related to its representation of Teva.

The recommendation comes from a magistrate judge and isn't binding on the senior judge on the case, which Mylan filed last month in federal court in western Pennsylvania, not far from its U.S. corporate headquarters.

Mylan said its relationship with Kirkland has given the law firm access to confidential information about products including its EpiPen allergic-reaction treatment, which Teva is now targeting with a competing product.

Kirkland said it had walled off attorneys working on Mylan's regulatory issues from those advising Teva. It also argued that it never worked for Mylan NV, the Dutch parent entity that emerged from a so-called "tax inversion" earlier this year, but had instead only worked for a handful of U.S.-based Mylan subsidiaries.

The judge rejected that argument. "Defendant's contention that the fortuitous circumstance of a recent reorganization adding a tier of holding-company ownership to the Mylan corporate affiliate structure now relieves it of an important component of its fiduciary duty is disquieting," the judge said.

Write to Liz Hoffman at liz.hoffman@wsj.com

Subscribe to WSJ: http://online.wsj.com?mod=djnwires