One firm focuses almost exclusively on parts of the tax code that affect the News Corporation. By taking advantage of a provision in the law that allows expanding companies like Mr. Murdoch’s to defer taxes to future years, the News Corporation paid no federal taxes in two of the last four years, and in the other two it paid only a fraction of what it otherwise would have owed. During that time, Securities and Exchange Commission records show, the News Corporation’s domestic pretax profits topped $9.4 billion.

The News Corporation’s outside lobbying team has been a veritable political Noah’s ark. It has included Republicans like Ed Gillespie, former Republican Party chairman; former Senator Alfonse M. D’Amato of New York; and the firm headed by former Mayor Rudolph W. Giuliani of New York. But it has also included former Democratic members of Congress, as well as several high-ranking Clinton administration officials, including Jack Quinn, former White House counsel.

Mr. Murdoch’s association with the Clintons is perhaps the best example of his ever-morphing relationships with the powerful, and theirs with him. For years, the former president was a favorite target of The New York Post, which seemed to delight in referring to him as “former horndog-in-chief.”

In October 2002, Mr. Clinton and Mr. Murdoch had a lunch meeting at Mr. Clinton’s office in Harlem. It was arranged by Mr. Ginsberg, who had worked in the White House counsel’s office in the Clinton administration and is now the News Corporation’s executive vice president for corporate affairs.

More recently, Mr. Murdoch donated $500,000 to the former president’s Global Initiative and was one of its featured panelists at a 2005 event in New York. In 2006, The Post issued a surprising endorsement of Mrs. Clinton in her Senate re-election bid. On June 5 and 6 of this year, Mr. Ginsberg and Peter A. Chernin, president and chief operating officer of the News Corporation, were hosts of back-to-back fund-raisers for Mrs. Clinton’s presidential campaign, one in New York and one in Los Angeles.

The Nielsen Battle

In early 2004, an alarm went off at the News Corporation headquarters.

Nielsen Media Research was preparing to switch to a more sophisticated technology to calculate ratings that television stations use to set advertising rates for local programming. Results of a trial run showed sharp drops in ratings for shows carried on stations owned by the News Corporation, particularly those aimed at minority viewers.

With millions of dollars at stake, Mr. Murdoch sprang into action. He hired the Glover Park Group, a consulting firm with deep ties to the Clinton administration, to run a grass-roots ground war. Charging that the system was faulty and that it undercounted minorities, the firm started an extensive advertising campaign intended to delay the rollout of the new technology and staged protests around the country that drew such unlikely allies as the Rev. Al Sharpton. Among the Democrats who wrote to Nielsen opposing the new system was Mrs. Clinton.