Apple, the Silicon Valley company, and Apple Corps, the Beatles' record label, are finally burying the hatchet.

In a move that could clear the way for songs by the legendary band to be sold through Apple's iTunes music store, the two companies announced today that they've settled their long-running trademark dispute.

As part of the agreement, Cupertino-based Apple will own the name Apple, the apple logos and all related trademarks. The iPod maker will license some of those trademarks back to Apple Corps.

``We love the Beatles, and it has been painful being at odds with them over these trademarks,'' Apple Chief Executive Steve Jobs said in a statement. ``It feels great to resolve this in a positive manner and in a way that should remove the potential of further disagreements in the future.''

Apple spokeswoman Natalie Kerris declined to say today whether or not a Beatles-iTunes deal will happen soon. However, company officials have said that they hope they can strike a deal with Apple Corps for the Beatles' catalog, she noted.

The deal had been rumored for weeks. Analysts have also expected the two companies to follow the agreement shortly with an announcement that iTunes will sell Beatles songs. Apple offers some 3.5 million songs through iTunes. The Beatles are one of a select few notable bands or musicians whose music is not sold by the store.

However, Elizabeth Freund, a spokeswoman for Apple Corps, said the companies had nothing to announce regarding the sale of Beatles songs on iTunes.

``This deal has nothing to do with that,'' she said. ``This is strictly a trademark agreement.''

The companies did not disclose the financial terms of the deal, other than that each company will be responsible for its own legal costs.

The Beatles record label and the Macintosh computer maker have battled over the rights to use the ``Apple'' name and symbol for nearly 30 years, dating back to the first years of Jobs' Apple. This deal marks the third settlement between them and replaces their most recent agreement, struck in 1991.

Apple Corps sued Apple for the third time in 2003, charging that the iPod maker had violated the 1991 agreement with the launch of iTunes, which put Apple in the music business, an area it had earlier agreed not to enter. Apple Corps was dealt a setback in that suit last year, when a U.K. court ruled in Apple's favor.

Apple Corps appealed the decision and a hearing was scheduled for this month. But that appeal will be canceled as a result of the new settlement, Freund said. Contact Troy Wolverton at (408) 920-5021 or twolverton@mercurynews.com.