However, the Basel-based company flagged an anticipated slowdown in demand for the tests, which have helped it fare better than some drugmakers as the number of routine hospital visits and demand for other medicines fell during the pandemic.

"As expected, demand for COVID-19 tests peaked in the second quarter and is likely to decrease in the second half of the year (although this) depends on how the pandemic develops," Chief Executive Severin Schwan said on a call with reporters, adding that there were still significant uncertainties.

Overall sales in the six months to June rose by 8% at constant currency rates to 30.71 billion Swiss francs ($33.48 billion) with core earnings up 6% to 10.56 francs per share. Analysts on average had expected sales of 29.93 billion francs and earnings of 10.10 francs per share, according to Jefferies.

Roche's shares were down 1.6% to 350.15 Swiss francs by 1204 GMT, the biggest decliner on the European pharmaceuticals index.

Strong momentum in other routine testing also boosted sales at the diagnostics division, which masked a 3% decline in pharmaceutical sales in the first six months.

ZKB analysts acknowledged that turnover was "significantly" better than expected, but said the lift from diagnostics was more likely to be considered a "flash in the pan".

Roche offers tests for everything from active COVID-19 infections to the antibodies that document immunity after somebody has been infected or vaccinated.

It is also in discussions with U.S. authorities over the use of its Gantenerumab drug as a potential treatment for Alzheimer's disease, which if approved could see it become a blockbuster.

Roche, which expects to increase its dividend this year, maintained its forecast for 2021 sales to grow at a low- to mid-single-digit rate at constant exchange rates, with core earnings per share growing by a similar amount.

"This virus will stay with us, it will continue to mutate, and as such there will be a continued need for vaccines, for new vaccines and boosters, as well as tests and medicines," CEO Schwan said.

JPMorgan analysts, however, said the move to leave guidance unchanged after a strong first-half performance could be seen as conservative.

($1 = 0.9174 Swiss francs)

(Reporting by Michael Shields in Zurich and Pushkala Aripaka in Bengaluru; Editing by Edmund Blair and Kirsten Donovan)

By Michael Shields