AOL Inc. has agreed to buy video advertising platform Adap.tv for $405 million in cash and stock, the company's biggest acquisition since Chief Executive Tim Armstrong took the reins in 2009.

Adap.tv's platform lets publishers and advertisers trade video advertising space in real time.

The deal was announced along with second-quarter earnings that showed signs of continued improvement in AOL's core business of selling advertising against its premium content.

Meanwhile AOL also signaled its plan to pull back on its costly Patch local news operations, with plans to exit certain Patch sites.

The Adap.tv purchase reflects AOL's increasing focus on two of the fastest-growing sectors of online advertising: video advertising and programmatic ad buying, which lets advertisers buy large and highly targeted amounts of online ad inventory through computerized trading desks.