SAN FRANCISCO — Google Inc. has retained the right to publish content from The Associated Press under a new licensing deal that thaws the sometimes-frosty relationship between the two companies.

The multiyear agreement announced Monday has two key components: an undisclosed payment for the rights to AP’s content, and a data-sharing arrangement aimed at helping the news cooperative make more money across the Internet.

The contract’s financial terms and duration weren’t disclosed.

The deal is part of AP’s effort to bring in more revenue from the Web as less money comes in from newspapers and broadcasters hard hit by an advertising slump.

As part of that process, AP renewed its licensing agreement with Yahoo Inc. earlier this year and is trying to strike a new deal with Microsoft Corp.

AP had been critical of the way Google and other sites have been able to control public access to news stories, without compensating the organizations that provide the content.

Citing confidentiality clauses in their new contract, AP and Google officials provided few specifics other than confirming that there will be greater collaboration than in their first licensing agreement, struck in 2006.

As the Internet’s dominant search engine, Google theoretically could provide the AP with more insights about the types of information and images people are looking for in the minutes, hours and days after a major news story breaks.