BERLIN (Reuters) - Rising costs for new models and technology will weigh on profits at BMW BMWG.DE for the rest of the year, it said on Tuesday, as the German carmaker battles to recapture ground lost to rival Mercedes-Benz DAIGn.DE.

The logo of BMW is pictured on a BMW 530e iPerformance before the company's annual news conference in Munich, southern Germany, March 21, 2017. REUTERS/Michael Dalder

BMW, the top seller of luxury cars for more than a decade, was overtaken by Mercedes last year, and its third quarter operating profit fell 3 percent as it invests in catching up.

The company, which is spending money on electric and self-driving technologies while also upgrading its line-up of conventional models, said upfront costs for the redesigned X3 sport-utility vehicle, due to hit showrooms this month, and the all-new X2 and X7 models would weigh on fourth-quarter results.

“Significant advance payments on R&D (research and development) will be necessary at present and in the coming years,” finance chief Nicolas Peter said during a results call.

He predicted a "challenging" fourth quarter, echoing Volkswagen's VOWG_p.DE Audi brand which is also refreshing its line-up of high-end and compact models.

BMW shares were down 2.7 percent to 87.53 euros at 1340 GMT, the biggest drop on Germany's benchmark DAX .GDAXI index.

"BMW used to be in a league of its own but these days it faces a totally different level of competition from Mercedes, Audi and Land Rover TAMO.NS, plus a load of other rebooted smaller players and of course Tesla TSLA.O," said Bernstein analyst Max Warburton.

Spending on R&D at the BMW group, which includes the Mini and Rolls Royce brands as well as its namesake cars, jumped over a fifth in the first nine months of this year to 4.1 billion euros ($4.7 billion), Peter said.

Third-quarter operating group profit fell to 2.3 billion euros, near the lowest 2.28-billion-euro forecast in a Reuters poll of analysts.

As a result, BMW’s operating margin slipped to 8.3 percent in the July-to-September quarter from 8.5 percent a year earlier, within its 8-10 percent target range but below Audi’s 8.9 percent and 9.2 percent at Mercedes.

“BMW’s competitive environment has changed and that’s evident in these Q3 numbers,” Warburton said.

Despite a 5.9 percent drop in quarterly pre-tax profit, BMW nudged up its full-year outlook to a 5-10 percent rise from 1-5 percent previously, thanks to a strong first-half performance.

Helped by strong demand for the redesigned 5 Series, BMW’s second best-selling model, and an upgraded 4 Series, it forecast a “slight” increase in deliveries to a new record this year.

But it pared back revenue expectations, forecasting sales at its core automotive operations to grow by 1-5 percent amid exchange rate headwinds and political volatility, down from 5-10 percent previously.

($1 = 0.8651 euros)