* Turned positive in July with net 206,000 T exports
* Spain has invested $5 bln in refinery upgrades
* Meanwhile diesel in strong demand elsewhere in Europe
MADRID, Oct 30 (Reuters) - Spain has become a net diesel exporter for the first time on record this year as demand has collapsed at home and major refinery upgrades have boosted production capacity, the country's strategic oil reserves corporation (CORES) said.
CORES data showed the balance of exports to imports turned positive with the net export of 206,000 tonnes in July and 281,000 tonnes in August.
Pedro Miras, head of CORES, told Reuters the data reflected falling domestic demand and work by firms such as Repsol , which made major improvements to its Cartagena refinery, working at full capacity early this year.
``Refining capacity is falling in Europe each year, whereas we have maintained our position, and it's now converting us into a net diesel exporter. This exporting trend should stabilise around current levels going forward,'' said Miras, who also heads the International Energy Agency's (IEA) committee on emergency stock releases.
Miras said the boost in exports, though relatively small, will help Spain as it faces a deepening recession and a tough battle to reduce the public deficit. Spain imports around 75 percent of all its energy needs and all of its crude oil.
Spanish companies have invested around 5 billion euros ($6.5 billion) in refinery upgrades over recent years, which have prevented at least one refinery closure and allowed the country to increase and diversify production.
Falling demand has also allowed refiners to export more. Provisional data for August showed that domestic car diesel consumption fell by 5.7 percent year-on-year.
At the same time, diesel is in strong demand in the rest of Europe, while U.S. exports to the region have declined in recent months, pushing up its price.
European refiners are mostly geared to produce more gasoline and cannot produce enough diesel to meet regional demand. This has favoured refiners that have upgraded facilities to produce more diesel.
Miras also said Spain's oil products reserves were already in compliance with new European Union rules to come into effect from Jan. 1 next year, which he said required countries to hold 30 days worth of emergency stocks of several fuel products.
Many European countries do not yet comply, because they hold stocks of crude oil more than of oil products, he said. OPEC members are obliged to hold 90 days worth of emergency oil stocks.
High stock levels will shelter Spain from potential supply shocks that have hit northern European countries due to refinery maintenance work, he said, before the winter season drives up demand for heating fuel.
``I think we are well prepared for any shock. The country's imports are geographically well diversified. We also have a very flexible and modern refining production, which allows us to refine all sorts of types of crude,'' he said.
He added that he did not see a need for an emergency release of stocks to prevent a supply crunch in Europe, though the IEA is monitoring developments on a daily basis. ($1 = 0.7749 euros)
(With reporting by Claire Milhench in London; Editing by Fiona Ortiz and Jane Baird)