WASHINGTON  It could be payback time.

An expensive legal and political campaign last year by Microsoft helped delay completion of Google’s $3.1 billion bid for the online advertising company DoubleClick. Microsoft filed briefs against the deal in the United States and abroad, testified against it in Congress, and worked with a public relations firm to generate opposition.

Now Google is preparing to strike back.

With Microsoft bidding nearly $45 billion to buy Yahoo, Google has begun to lay the groundwork to try to delay, and possibly derail, any deal. Google executives have asked company lobbyists to develop a political strategy to challenge the acquisition, which could threaten Google’s dominance of Internet advertising. Google’s top legal officer posted a statement Sunday that criticized the proposed deal.

Spokesmen for the two companies in Washington declined to comment Monday about a looming legal and political battle, which has yet to fully emerge and is likely to stay below the radar at least until the control of Yahoo seems clear.

Moreover, some antitrust specialists and government officials said Google might tread carefully in opposing any deal since it could backfire.