* Q2 EBIT down 6.3 pct
* Q2 deliveries up 0.7 pct to 637,878 vehicles
* BMW says commodities, R&D spending hit margin
* Shares closed down 0.4 pct (Adds CEO comment on tariffs, analyst comment)
FRANKFURT, Aug 2 (Reuters) - BMW reported a smaller-than-expected 6 percent decline in second quarter operating profit on Thursday while brushing off concerns about new anti-pollution rules and trade tensions which caused rival Daimler to warn on profits.
The German carmaker said higher spending to develop electric and autonomous cars and currency headwinds weighed on earnings before interest and taxes (EBIT), which fell to 2.74 billion euros ($3.19 billion) but topped the 2.69 billion expected by analysts.
BMW affirmed its 2018 targets, unlike Daimler which issued a profit warning in June, and rival VW, which cautioned that its margins were at risk because of problems getting its vehicles certified for new anti-pollution rules.
"This is arguably the best-run automaker. It is certainly the most stable," Max Warburton, an analyst at Bernstein Research, said of the company's results.
BMW said its automotive EBIT margin narrowed to 8.6 percent from 10.1 percent a year earlier thanks to higher spending to develop electric and autonomous cars.
Adjusted for comparability, BMW's automotive margin came in at 9.3 percent versus 9.2 percent for Volkswagen's Audi brand and 9.6 percent for Daimler's Mercedes-Benz, analysts at Evercore ISI said.
BMW said it expects capital expenditure to reach an all-time high in 2018 as it pushes zero-emissions cars and opens a battery cell competence centre with expertise in developing and producing battery cells in early 2019.
"We will also be purchasing raw materials for battery cells ourselves, especially cobalt, in the future," Chief Executive Harald Krueger told investors on a call to discuss earnings.
BMW said it will continue to offer its customers almost all of the cars in its fleet, while Mercedes-Benz and VW warned that problems certifying vehicles to the new Worldwide Harmonized Light Duty Vehicles Test Procedure (WLTP) would result in a more limited product offering, potentially damaging margins.
Volkswagen said that only 60 percent of its VW branded vehicles will conform to the WLTP emissions test standard by the end of August.
"We see some advantages when compared with our competitors," Krueger said, explaining that waiting times for a new car were no longer than three months and that BMW's ability to offer products could help it steal market share from rivals.
BMW, whose shares closed 0.4 percent lower, also said increased efficiency measures had helped offset a triple-digit million euro headwind from foreign exchange rates and raw materials.
Because BMW earlier this year stopped exporting its X3 offroader from Spartanburg, South Carolina, to China it has been able to avoid a 40 percent import tariff, imposed since July, while rivals such as Mercedes still export large SUVs from the United States.
Demand for new models like the large X7 sports utility vehicle are so high that BMW is confident it can adjust prices to still make a profit on cars exported from the United States to China.
It has already raised prices on its X5 and X6 models imported from Spartanburg and is building a "significant portion" of between 10,000 and 20,000 X5 models in Thailand so they can be exported to China.
"This is one action to counteract," Krueger said, referring to hurdles thrown up by tariffs.
Tariffs were introduced as part of a broader trade dispute as the United States seeks to "rebalance" trade relationships with the European Union and China. These tariffs will have a low to midsize triple-digit million euros impact, Chief Financial Officer Nicolas Peter said.
This may force carmakers to retool their production networks to curb inter-continental exports and to serve regional trading blocs instead. BMW has already announced an expansion of its product capacity in China and Europe this year.
Krueger said he had met British Prime Minister Theresa May to underscore the need for Britain to maintain trading ties to the European Union.
"I explained this complex situation to her and what business preconditions we need. Britain should stay in the customs union," Krueger told journalists on a call.
Daimler, Fiat Chrysler and General Motors and supplier Valeo all blamed trade tensions for lowering their profit forecasts for the year.
($1 = 0.8586 euros) (Reporting by Edward Taylor; editing by Maria Sheahan, Jason Neely and Adrian Croft)