Google has agreed to buy DoubleClick for $3.1 billion (£1.58bn) in cash, in an acquisition that will shake up the online advertising market.

DoubleClick's network of advertisers and web publishers, as well as its technology to serve ads and manage campaigns, is expected to boost Google's ad business, specifically for display and rich media advertising, which aren't Google's specialties.

Google generates most of its revenue from search engine, pay-per-click advertising, which are text ads that link to advertisers' websites, but it has lagged behind Yahoo and others in banner, graphical and video ads.

Google is buying DoubleClick from private equity firm Hellman & Friedman and JMI Equity and management. The deal is expected to close by the end of the year.

"By working together, we're going to be able to offer a variety of tools for advertisers to do better Internet targeting," said Susan Wojcicki, a vice president of product management with Google. "Advertisers will be able to spend more and be able to make rational decisions about how they are spending their ad dollars."

The fact that there is such an "obvious alignment" between Google and DoubleClick advertising partners was an impetus for the deal, said Google chief executive, Eric Schmidt. "DoubleClick has been a partner of ours for a very long time, and some of the most important advertising partners of Google are in fact very big DoubleClick users," he said.

Google officials spoke only generally about product plans. "It's not good for us to speculate right now on what we might do," Schmidt said. "This merger is really part of a global growth strategy for Google. It's a way of solving, in an end-to-end way, problems in search and display advertising."

Recent rumours had Microsoft aiming to buy DoubleClick for about $bn, so Friday's announcement signals that a bidding war had erupted with Google, said industry analyst Greg Sterling of Sterling Market Intelligence.

The deal is a clear loss for Microsoft and it stands to affect Yahoo as well, because with DoubleClick, Google gets a much-needed boost in display advertising, Sterling said.

Companies such as DoubleClick that link advertisers and web publishers have thrived in recent years, thanks to the strong growth in online ad spending, said Clayton Moran, a financial analyst with Stanford Group Company, prior to the announcement.

"The facilitators of online advertising have done very well, because demand for Internet advertising has been very strong," Moran said.

He doesn't track DoubleClick because it is a privately held company, but he does follow publicly traded competitors such as 24/7 Real Media and ValueClick. Last year, Real Media's revenue was $200.2 million, an increase of 43% from 2005. Meanwhile, ValueClick grew its revenue to $545.6 million, an increase of 79% from 2005.

The deal may make it harder for Microsoft's struggling online division to compete with Google.

Despite heavy investments of money, resources and personnel to develop its own search engine and search ad network, Microsoft hasn't been able to come close to matching the levels of online ad revenue Google and Yahoo have achieved. Microsoft has failed to benefit as much as it should have from the surge in online ad spending of recent years.

But traffic to Microsoft's websites is strong. In fact, Microsoft consistently ranks first in website visitors worldwide. However, Microsoft hasn't monetised this traffic properly.

Moreover, Microsoft hasn't been able to compete effectively for traffic in the search engine market, where Google rules, and this has affected its ability to take advantage of search engine ads, which make up about 40% of US online ad spending.

In December, Microsoft's share of US search engine queries was 10.5%, while Google nabbed 47.3%, according to comScore Networks. In July 2005, It also said Microsoft's US search engine query share stood at 15.5% and Google's at 36.5%.

DoubleClick, founded in 1996, serves ad buyers such as ad agencies and corporate marketers, and ad sellers such as website publishers. It has two main divisions. Its Dart division provides tools and services to both buy and sell advertising, primarily display and rich media ads. Meanwhile, the Performics division focuses on search engine marketing, commonly based on the pay-per-click ads in which Google specialises.