* July crude runs 12.53 mln bpd, -8.8% yr/yr

* Jan-July runs down 6.3% on year

* Unplanned shutdowns at state refineries; teapots trim runs

* Jan-July crude output +3.7% on yr; gas up 5.4%

SINGAPORE, Aug 15 (Reuters) - China's refinery crude throughput fell last month to its lowest since March 2020 as several state refiners underwent unplanned shutdowns and their independent peers trimmed production in response to thinning margins.

Refiners processed 53.21 million tonnes of crude oil in July, 8.8% less than a year earlier, according to data from the National Bureau of Statistics (NBS).

That is equivalent to 12.53 million barrels per day (bpd), the lowest daily rate since March 2020, and compared with 13.37 million bpd in June.

The weaker throughput in July extended a rare decline in China's refinery processing seen in the first half of 2022 as strict COVID-19 lockdowns and fuel export controls curbed their production.

China is the world's biggest crude oil importer and its fuel production data influences international fuel prices and is closely watched by analysts to get a sense of how the world's second-biggest economy is faring.

During the first seven months, refineries processed 380.27 million tonnes, down 6.3% on a year before and equal to about 13.09 million bpd.

Prolonged outages at large state-run refineries such as Sinopec Shanghai Petrochemical Corp's 320,000-bpd crude facility and PetroChina Wepec's 200,000-bpd plant weighed on national production.

Sinopec did not resume refining at some of the units at the Shanghai plant until last week, while the northeast Liaoning-based Wepec was not expected to resume operation until late August after nearly three months' shutdown, said an industry source.

PetroChina did not immediately respond to an emailed request for comment.

Meanwhile, operations at independent refiners began trending lower from late-July as margins narrowed. Their output could come under further downward pressure in coming months as the central government readies to conduct a new round of tax investigations.

The NBS data showed China's crude oil production last month was up 3% on the year before at 17.13 million tonnes, with daily output at 4.03 million bpd. June production was at an all-time high of 4.18 million bpd.

Crude oil production in the first seven months was 3.7% higher than a year earlier at 120 million tonnes (4.13 million bpd), as national oil firms accelerated developing conventional and unconventional resources in response to Beijing's call to boost domestic supply security.

Despite record production, the increase remains marginal as China imports nearly three quarters of its crude oil.

Natural gas production regained strength in July, with 8.2% annual growth to 17.1 billion cubic meters. This compared with a marginal 0.4% rise seen in June.

Year-to-date production was up 5.4% at 126.7 bcm. (Tonne = 7.3 barrels for crude conversion) (Reporting by Chen Aizhu and Muyu Xu; Editing by Uttaresh.V and Muralikumar Anantharaman)