By Ben Hirschler

LONDON (Reuters) - AstraZeneca <AZN.L> has sold the marketing rights to a portfolio of anesthetics for up to $770 million in the latest so-called externalization deal to raise funds for investment in new drugs.

South Africa's Aspen Pharmacare <APNJ.J> will market the seven established medicines outside the United States under the deal, which follows the sale of U.S. rights to the anesthetics 10 years ago to Abraxis, now part of Fresenius Kabi <FRES.M3>.

Aspen will pay AstraZeneca $520 million upfront and up to $250 million in sales-related payments, as well as double-digit percentage trademark royalties, the companies said on Thursday.

Aspen Chief Executive Stephen Saad said it was an "excellent opportunity" for the South African firm and its shares jumped 10 percent in Johannesburg. AstraZeneca stock fell 0.8 percent.

The agreement covers Diprivan, used for general anesthesia, EMLA, a topical anesthetic, and five local anesthetics. The anesthetics, which are sold in more than a hundred countries, had sales in 2015 of $592 million.

AstraZeneca will continue to manufacture and supply the products on a cost plus basis to Aspen for an initial 10 years.

AstraZeneca has used externalization income from licensing out products in non-core areas, such as neuroscience, to help fund investment in new medicines in cancer and other fields.

Externalization has helped underpin AstraZeneca's profits at a time it is facing a raft of patent expiries on previous blockbuster drugs, such as cholesterol fighter Crestor and heartburn medicine Nexium, but it has led to criticism about the quality of earnings from some analysts.

Externalization deals contributed $1.1 billion to revenue last year and the company has said the figure will be higher in 2016.

(Additional reporting by Paul Sandle; editing by David Clarke)