A joint venture company has been formed to run the Grangemouth refinery on the Forth.
It has brought together current operators Ineos and the Chinese company PetroChina.
Finance Secretary John Swinney said the £626m deal secures more than 2,000 jobs associated with Grangemouth.
The refinery processes about 210,000 barrels of crude oil each day, supplying Scotland, Northern Ireland and the north of England.
Ineos directly employs more than 1,000 people at Grangemouth and a plant of similar size at Lavéra in France.
The agreement followed a period of detailed negotiation, after PetroChina made an offer in January for a 50% share in the business.
Welcoming the agreement, Mr Swinney said: “Scotland has unrivalled energy resources and expertise, and the Scottish government is committed to working with China across this sector.
“This joint venture enhances security of supply for customers and retains the jobs and skills that have been built up over many years at Grangemouth.
“We will continue to identify opportunities to share information, expertise and technology between our two countries.”
This article is from the BBC News website. © British Broadcasting Corporation, The BBC is not responsible for the content of external internet sites.