BERLIN, Oct 5 (Reuters) - German industrial orders rose more than expected in August due to a strong increase in computing, electronic and optical products, but the outlook for the sector remains challenging.

Orders rose by 3.9% on the previous month on a seasonally and calendar adjusted basis, the federal statistics office said on Friday.

A Reuters poll of analysts had pointed to a rise of 1.8%.

"This means that incoming orders have stabilised after a two-year decline," said Ralph Solveen, chief economist at Commerzbank. However, this stabilisation is at a lower level than before and companies will have to gradually adjust their production in the coming months.

The less volatile three-month on three-month comparison showed that new orders were 4.9% higher in the period from June to August than in the previous three months.

The increase in August follows a sharp decline the previous month. The statistics office revised July's drop to 11.3% compared with June, from a provisional decline of 11.7%.

In August, an increase of 37.9% on the month in the manufacturing of computer, electronic and optical products drove the expansion in industrial orders. The manufacturing of electronic components was largely responsible for the increase, the statistics office said.

Foreign orders were up 3.9% on the month and domestic orders rose by 4.0%, the data showed.

"The weak external environment and the high level of uncertainty in Germany still call for caution," said Bastian Hepperle, senior economist at Hauck Aufhaeuser Lampe Privatbank. He said the weak period in the manufacturing sector was likely to continue.

Despite the positive data for August, Germany's manufacturing sector, which accounts for about a fifth of its economy, remains mired in a downturn.

The HCOB final Purchasing Managers' Index (PMI) for manufacturing stood at 39.6 in September, far below the 50 level separating growth from contraction.

Not only are important foreign markets struggling, but high energy prices are also a serious burden, said Thomas Gitzel, chief economist at VP Bank, although he noted some signs of stabilisation in global manufacturing.

"This feeds the hope that after a period of bottoming out, things will at least start to go up again a bit," Gitzel said. (Reporting by Rachel More and Maria Martinez Editing by Christina Fincher and Mark Potter)