SAN FRANCISCO -- Advanced Micro Devices agreed to sell and lease back its campus in Austin, Texas, to raise $164 million in cash and fund its chipmaking business as the Sunnyvale company diversifies beyond the struggling PC industry into new markets.

AMD said that following the sale of its "Lone Star Campus" to an affiliate of Spear Street Capital, it would enter into a 12-year lease to continue its operations there.

The sale of the campus comes as the company and its larger Santa Clara rival, Intel (INTC), struggle with slowing personal computer sales.

AMD said it expected its first-quarter results to include proceeds of the deal and a special charge of about $50 million for the difference between the sale proceeds and the carry value of the property.

With the growing popularity of Apple's (AAPL) iPad and other tablets sapping demand for PCs, AMD, one of Silicon Valley's oldest chipmakers, has laid off engineers while looking for new markets for its products.

AMD sold and leased back its Sunnyvale headquarters in 1998.